Empty name is obviously invalid - method should return false. Signed-off-by: Marek Zawirski <marek.zawirski@xxxxxxxxx> --- .../src/org/spearce/jgit/lib/Repository.java | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java index a8591cc..17cdb40 100644 --- a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java +++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java @@ -986,6 +986,9 @@ public class Repository { */ public static boolean isValidRefName(final String refName) { final int len = refName.length(); + if (len == 0) + return false; + char p = '\0'; for (int i=0; i<len; ++i) { char c = refName.charAt(i); -- 1.5.6.3 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html