Browse Source

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 <spearce@spearce.org>
stable-0.12
Shawn O. Pearce 14 years ago committed by Chris Aniszczyk
parent
commit
f9c9fe5226
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java

2
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java

@ -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 (;;) {

Loading…
Cancel
Save