aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2016-01-14 16:11:15 -0800
committerShawn Pearce <spearce@spearce.org>2016-01-15 11:07:19 -0800
commita290b822ab4f0ec9c1e5121235564fadf594a74e (patch)
treed1976ca65a95ff5eb536c35074e7405a2aad559b /org.eclipse.jgit.test
parentf52581c6a50d841e1939dbd69d174effa63c8c57 (diff)
downloadjgit-a290b822ab4f0ec9c1e5121235564fadf594a74e.tar.gz
jgit-a290b822ab4f0ec9c1e5121235564fadf594a74e.zip
RefTreeDatabase: Expose bootstrap refs in getAdditionalRefs
By showing the bootstrap layer in getAdditionalRefs() garbage collector code can be more RefDatabase agnostic and not care about the special case of RefTree and RefTreeNames for the purposes of building up the roots to GC. Instead they can combine getRefs(ALL) and getAdditionalRefs() and have a clean set of roots. Change-Id: I665cd2456e9316640215b6a08bc728d1356f36d8
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/reftree/RefTreeDatabaseTest.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/reftree/RefTreeDatabaseTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/reftree/RefTreeDatabaseTest.java
index 020d1b1b51..1bacfe46f0 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/reftree/RefTreeDatabaseTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/reftree/RefTreeDatabaseTest.java
@@ -124,6 +124,17 @@ public class RefTreeDatabaseTest {
assertTrue("no references", refdb.getRefs(ALL).isEmpty());
assertTrue("no references", refdb.getRefs(R_HEADS).isEmpty());
assertTrue("no references", refdb.getRefs(R_TAGS).isEmpty());
+ assertTrue("no references", refdb.getAdditionalRefs().isEmpty());
+ }
+
+ @Test
+ public void testGetAdditionalRefs() throws IOException {
+ update("refs/heads/master", A);
+
+ List<Ref> addl = refdb.getAdditionalRefs();
+ assertEquals(1, addl.size());
+ assertEquals("refs/txn/committed", addl.get(0).getName());
+ assertEquals(getTxnCommitted(), addl.get(0).getObjectId());
}
@Test