git-fetch-pack: Implement client part of the multi_ack extension

This patch concludes the series, which makes
git-fetch-pack/git-upload-pack negotiate a potentially better set of
common revs. It should make a difference when fetching from a repository
with a few branches.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Johannes Schindelin
2005-10-23 03:40:13 +02:00
committed by Junio C Hamano
parent 69779a562a
commit 40a1046249
2 changed files with 41 additions and 14 deletions

View File

@ -59,8 +59,11 @@ int get_ack(int fd, unsigned char *result_sha1)
if (!strcmp(line, "NAK"))
return 0;
if (!strncmp(line, "ACK ", 3)) {
if (!get_sha1_hex(line+4, result_sha1))
if (!get_sha1_hex(line+4, result_sha1)) {
if (strstr(line+45, "continue"))
return 2;
return 1;
}
}
die("git-fetch_pack: expected ACK/NAK, got '%s'", line);
}