diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java index b51a954ca..3a3e1c558 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java @@ -597,7 +597,7 @@ private ObjectId resolveSimple(final String revstr) throws IOException { return resolveAbbreviation(revstr); int dashg = revstr.indexOf("-g"); - if (4 < revstr.length() && 0 <= dashg + if ((dashg + 4) < revstr.length() && 0 <= dashg && isHex(revstr.charAt(dashg + 2)) && isHex(revstr.charAt(dashg + 3)) && isAllHex(revstr, dashg + 4)) {