]> source.dussan.org Git - jgit.git/commitdiff
UploadPack: Assume okToGiveUp is initially false 31/2431/2
authorShawn O. Pearce <spearce@spearce.org>
Sun, 6 Feb 2011 08:42:23 +0000 (00:42 -0800)
committerChris Aniszczyk <caniszczyk@gmail.com>
Sun, 13 Feb 2011 21:30:25 +0000 (15:30 -0600)
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 <spearce@spearce.org>
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java

index 52d7c37533aabe72034c67f85887eb4e0e287705..175ddbcba2884c49bf8ed84a20cda97672722f87 100644 (file)
@@ -415,6 +415,8 @@ public class UploadPack {
        }
 
        private boolean negotiate() throws IOException {
+               okToGiveUp = Boolean.FALSE;
+
                ObjectId last = ObjectId.zeroId();
                List<ObjectId> peerHas = new ArrayList<ObjectId>(64);
                for (;;) {