From: Junio C Hamano Date: Sun, 27 Mar 2011 03:13:15 +0000 (-0700) Subject: Merge branch 'jc/fetch-progressive-stride' X-Git-Tag: v1.7.5-rc0~22 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b3369abfeb4b1630905de2ab516aeb946c0c19db;p=git.git Merge branch 'jc/fetch-progressive-stride' * jc/fetch-progressive-stride: fetch-pack: use smaller handshake window for initial request fetch-pack: progressively use larger handshake windows fetch-pack: factor out hardcoded handshake window size Conflicts: builtin/fetch-pack.c --- b3369abfeb4b1630905de2ab516aeb946c0c19db diff --cc builtin/fetch-pack.c index 0ef9a1194,3c2c9406c..bf9990ce1 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @@@ -219,16 -218,20 +219,30 @@@ static void send_request(int fd, struc safe_write(fd, buf->buf, buf->len); } +static void insert_one_alternate_ref(const struct ref *ref, void *unused) +{ + rev_list_insert_ref(NULL, ref->old_sha1, 0, NULL); +} + +static void insert_alternate_refs(void) +{ + foreach_alt_odb(refs_from_alternate_cb, insert_one_alternate_ref); +} + + #define INITIAL_FLUSH 16 + #define LARGE_FLUSH 1024 + + static int next_flush(int count) + { + if (count < INITIAL_FLUSH * 2) + count += INITIAL_FLUSH; + else if (count < LARGE_FLUSH) + count <<= 1; + else + count += LARGE_FLUSH; + return count; + } + static int find_common(int fd[2], unsigned char *result_sha1, struct ref *refs) {