From ac53b4679a3bb8ad2df7d6e5897bd013d45024f1 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 15 Jun 2018 11:41:00 +0100 Subject: [PATCH] When removing a key that does exist then original GitDbBranch can still find it --- src/test/java/net/kemitix/gitdb/test/GitDBTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/java/net/kemitix/gitdb/test/GitDBTest.java b/src/test/java/net/kemitix/gitdb/test/GitDBTest.java index a876aa8..43cdc05 100644 --- a/src/test/java/net/kemitix/gitdb/test/GitDBTest.java +++ b/src/test/java/net/kemitix/gitdb/test/GitDBTest.java @@ -260,6 +260,16 @@ class GitDBTest implements WithAssertions { } // When removing a key that does exist then original GitDbBranch can still find it + @Test + void removeKey_whenExists_thenOriginalCanStillFind() throws IOException { + //given + final GitDBBranch originalBranch = gitDBBranch().put("key-name", "value"); + //when + final GitDBBranch updatedBranch = originalBranch.remove("key-name"); + //then + assertThat(originalBranch.get("key-name")).contains("value"); + } + // When removing a key that does exist then the updated GitDbBranch can't find it // When starting a named transaction then GitDbTransaction is returned