From: Robin Rosenberg Date: Sun, 08 Mar 2009 15:21:07 GMT Subject: [EGIT PATCH] Prevent an exception if the user tries to push a non-existing ref. Message-ID: <1236525667-852-1-git-send-email-robin.rosenberg@dewire.com> In-Reply-To: <20090307224831.GS16213@spearce.org> Instead of a StringIndexOutOfBoundsException we now get an error telling us that the ref could not be resolved. Signed-off-by: Robin Rosenberg --- .../src/org/spearce/jgit/transport/Transport.java | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java b/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java index a0a2575..8a25213 100644 --- a/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java +++ b/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java @@ -255,7 +255,7 @@ else if (TransportLocal.canHandle(remote)) } else { if (!remoteName.startsWith(Constants.R_REFS)) { // null source is another special case (delete) - if (srcRef != null) { + if (src != null) { // assume the same type of ref at the destination String srcPrefix = srcRef.substring(0, srcRef.indexOf('/', Constants.R_REFS.length())); remoteName = srcPrefix + "/" + remoteName; -- 1.6.1.285.g35d8b