]> source.dussan.org Git - jgit.git/commit
Introduce RefDatabase#getTipsWithSha1 to list refs pointing to object 47/135547/7
authorPatrick Hiesel <hiesel@google.com>
Tue, 22 Jan 2019 09:02:14 +0000 (10:02 +0100)
committerJonathan Nieder <jrn@google.com>
Tue, 9 Apr 2019 00:53:51 +0000 (17:53 -0700)
commit93a0e50ed087ec2de2b57483d2775a20fab03b75
tree32702746bc483de410b0ba350b1eed4bdfc10a66
parentee32ca226e9a4aa2ff48bfdd1ba1d2184317c668
Introduce RefDatabase#getTipsWithSha1 to list refs pointing to object

Add resolveTipSha1, an inverse of exactRef(String ...), to RefDatabase
and provide a default implementation that runs in O(n) time where n is
the number of refs. For RefTable, provide an implementation that runs
in O(log(n)) time.

[ifrade@google.com: with tests in InMemoryRepositoryTest to exercise
 the reftable code path, too]

Change-Id: I2811ccd0339cdc1c74b42cce2ea003f07a2ce9e1
Signed-off-by: Patrick Hiesel <hiesel@google.com>
Signed-off-by: Ivan Frade <ifrade@google.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/InMemoryRepositoryTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefTest.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReftableDatabase.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java