diff options
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java index ef22fb90fe..b62033cbd2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java @@ -239,20 +239,11 @@ public abstract class RefDatabase { * @since 4.1 */ public Ref exactRef(String name) throws IOException { - int slash = name.lastIndexOf('/'); - String prefix = name.substring(0, slash + 1); - String rest = name.substring(slash + 1); - Ref result = getRefs(prefix).get(rest); - if (result != null || slash != -1) { - return result; + Ref ref = getRef(name); + if (ref == null || !name.equals(ref.getName())) { + return null; } - - for (Ref ref : getAdditionalRefs()) { - if (name.equals(ref.getName())) { - return ref; - } - } - return null; + return ref; } /** |