summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-09-29 16:57:13 -0700
committerJunio C Hamano <gitster@pobox.com>2016-09-29 16:57:13 -0700
commit938c2a63212847bf87fc2a7076ccd4e15dfa3955 (patch)
tree210b729986409032610fe25f3d30b7d03cc623ce
parent5c2c2d4aeed92ce047e889f415b513e1ee6ac3de (diff)
parent06b3d386e0a5841c11b6730f95c44068790d791e (diff)
downloadgit-938c2a63212847bf87fc2a7076ccd4e15dfa3955.tar.gz
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
-rw-r--r--fetch-pack.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index 85e77af61d..413937e740 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -428,10 +428,17 @@ static int find_common(struct fetch_pack_args *args,
const char *hex = sha1_to_hex(result_sha1);
packet_buf_write(&req_buf, "have %s\n", hex);
state_len = req_buf.len;
- }
+ /*
+ * Reset in_vain because an ack
+ * for this commit has not been
+ * seen.
+ */
+ in_vain = 0;
+ } else if (!args->stateless_rpc
+ || ack != ACK_common)
+ in_vain = 0;
mark_common(commit, 0, 1);
retval = 0;
- in_vain = 0;
got_continue = 1;
if (ack == ACK_ready) {
clear_prio_queue(&rev_list);