Skip to content

Commit 938c2a6

Browse files
committed
Merge branch 'jt/fetch-pack-in-vain-count-with-stateless'
When "git fetch" tries to find where the history of the repository it runs in has diverged from what the other side has, it has a mechanism to avoid digging too deep into irrelevant side branches. This however did not work well over the "smart-http" transport due to a design bug, which has been fixed. * jt/fetch-pack-in-vain-count-with-stateless: fetch-pack: do not reset in_vain on non-novel acks
2 parents 5c2c2d4 + 06b3d38 commit 938c2a6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

fetch-pack.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,10 +428,17 @@ static int find_common(struct fetch_pack_args *args,
428428
const char *hex = sha1_to_hex(result_sha1);
429429
packet_buf_write(&req_buf, "have %s\n", hex);
430430
state_len = req_buf.len;
431-
}
431+
/*
432+
* Reset in_vain because an ack
433+
* for this commit has not been
434+
* seen.
435+
*/
436+
in_vain = 0;
437+
} else if (!args->stateless_rpc
438+
|| ack != ACK_common)
439+
in_vain = 0;
432440
mark_common(commit, 0, 1);
433441
retval = 0;
434-
in_vain = 0;
435442
got_continue = 1;
436443
if (ack == ACK_ready) {
437444
clear_prio_queue(&rev_list);

0 commit comments

Comments
 (0)