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>
This commit is contained in:
Shawn O. Pearce 2011-02-06 00:42:23 -08:00 committed by Chris Aniszczyk
parent d6b7139cd8
commit f9c9fe5226
1 changed files with 2 additions and 0 deletions

View File

@ -415,6 +415,8 @@ private void recvWants() throws IOException {
}
private boolean negotiate() throws IOException {
okToGiveUp = Boolean.FALSE;
ObjectId last = ObjectId.zeroId();
List<ObjectId> peerHas = new ArrayList<ObjectId>(64);
for (;;) {