summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2011-03-16 21:44:34 -0700
committerShawn O. Pearce <spearce@spearce.org>2011-03-17 10:51:31 -0700
commitb0a29c3fcfae9f23949db5cbee46db30448531cf (patch)
tree40932c9742b454c493c5be41b859cf3500a5eea7 /org.eclipse.jgit
parent00a50401478171b900b5f1ea16c43618293706ce (diff)
downloadjgit-b0a29c3fcfae9f23949db5cbee46db30448531cf.tar.gz
jgit-b0a29c3fcfae9f23949db5cbee46db30448531cf.zip
Handle "ERR %s" when ACK/NAK is expected
If the remote peer replies with "ERR %s" instead of "ACK %s common" or "NAK" during ancestor negotiation in the fetch-pack/upload-pack protocol, treat that as an exception that aborts processing with the error text as supplied by the remote system. This matches behavior with "ERR %s" during the advertisements, which is also a way for the remote to abort processing. Change-Id: I2fe818e75c7f46156744ef4f703c40173cbc76d0 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java
index 01d92770bc..e5b2494c88 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java
@@ -101,6 +101,8 @@ class PacketLineIn {
else if (arg.equals(" ready"))
return AckNackResult.ACK_READY;
}
+ if (line.startsWith("ERR "))
+ throw new PackProtocolException(line.substring(4));
throw new PackProtocolException(MessageFormat.format(JGitText.get().expectedACKNAKGot, line));
}