From: Robin Stocker Date: Thu, 8 Nov 2012 13:17:13 +0000 (+0100) Subject: Fix redundant null check warning in Repository X-Git-Tag: v2.2.0.201212191850-r~46 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F98%2F8598%2F1;p=jgit.git Fix redundant null check warning in Repository rev is always null because of `if (rev != null) return ...` above. Change-Id: I8168aefd344e0c4b0c68caea1a3daee66c07173b --- 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 76f5378179..911b1f6a7c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java @@ -697,7 +697,7 @@ public abstract class Repository { return rev.copy(); if (name != null) return name; - if (rev == null && done == revstr.length()) + if (done == revstr.length()) return null; name = revstr.substring(done); if (!Repository.isValidRefName("x/" + name))