From f9c9fe52266c7a64a6a72eb90287b6e872c142e9 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Sun, 6 Feb 2011 00:42:23 -0800 Subject: [PATCH] UploadPack: Assume okToGiveUp is initially false When negotiate() starts there is at least one want, but no haves, and thus no common base exists. Its not ok to give up yet, the client should try to find a common base with the server. Avoid scanning our history along the want chains until we have found at least one commit in common with the client, this will trigger okToGiveUp to be set to null, enabling okToGiveUp() to perform the scan. Bug: 301639 Change-Id: I98a82a5424fd4c9995924375c7910f76ca4f03af Signed-off-by: Shawn O. Pearce --- org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java index 52d7c3753..175ddbcba 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java @@ -415,6 +415,8 @@ private void recvWants() throws IOException { } private boolean negotiate() throws IOException { + okToGiveUp = Boolean.FALSE; + ObjectId last = ObjectId.zeroId(); List peerHas = new ArrayList(64); for (;;) {