From 2f0a093dd640e0dad0b261dae2427f2541b5426c Mon Sep 17 00:00:00 2001 From: Jonathan Tan Date: Mon, 27 Apr 2020 17:01:10 -0700 Subject: fetch-pack: in protocol v2, reset in_vain upon ACK In the function process_acks() in fetch-pack.c, the variable received_ack is meant to track that an ACK was received, but it was never set. This results in negotiation terminating prematurely through the in_vain counter, when the counter should have been reset upon every ACK. Therefore, reset the in_vain counter upon every ACK. Helped-by: Jonathan Nieder Signed-off-by: Jonathan Tan Reviewed-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- fetch-pack.c | 1 + 1 file changed, 1 insertion(+) (limited to 'fetch-pack.c') diff --git a/fetch-pack.c b/fetch-pack.c index 3891f8bb86..10314df25b 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -1307,6 +1307,7 @@ static enum common_found process_acks(struct fetch_negotiator *negotiator, if (skip_prefix(reader->line, "ACK ", &arg)) { struct object_id oid; + received_ack = 1; if (!get_oid_hex(arg, &oid)) { struct commit *commit; oidset_insert(common, &oid); -- cgit v1.2.3