]> source.dussan.org Git - jgit.git/commit
RefDatabase: Introduce findRef synonym for getRef 70/49570/9
authorJonathan Nieder <jrn@google.com>
Thu, 12 Nov 2015 00:10:24 +0000 (16:10 -0800)
committerJonathan Nieder <jrn@google.com>
Thu, 27 Dec 2018 04:49:35 +0000 (20:49 -0800)
commitc1954f6c366121f971699573322a2669c7dd9430
treeee6ceac67ed4df68d3e52403caaf8b44f7d7744b
parentd2bab654700cff1ea0427156aef1b18a6d3bd9ac
RefDatabase: Introduce findRef synonym for getRef

Using findRef instead of getRef makes it clearer that the caller wants
to search for the ref in the search path, instead of looking for a ref
that exactly matches the input.

This change introduces the new findRef method and deprecates getRef.
It updates Repository#findRef to use the new method, ensuring some
test coverage.  Other callers will be updated in followup changes.

A nice side effect of introducing the new findRef method is that it is
final and based on firstExactRef, so implementers can focus on
implementing the latter efficiently and do not have to carefully write
custom path search code respecting SEARCH_PATH.

Change-Id: Id3bb944344a9743705fd1f20193ab679298fa51c
Signed-off-by: Jonathan Nieder <jrn@google.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefDatabaseConflictingNamesTest.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsRefDatabase.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReftableDatabase.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftree/RefTreeDatabase.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java