]> git.ipfire.org Git - thirdparty/git.git/commit
fetch-pack: directly end negotiation if ACK ready
authorJonathan Tan <jonathantanmy@google.com>
Thu, 14 Jun 2018 22:54:24 +0000 (15:54 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 15 Jun 2018 15:44:23 +0000 (08:44 -0700)
commit21bcf6e429e01961d38bc639b2dc4a6f64b8fdcf
treefa356779736089a0cb8b09a508f76702168e7102
parentaf008558cc2e16c96ddafc6c7a9453ea3d18957b
fetch-pack: directly end negotiation if ACK ready

When "ACK %s ready" is received, find_common() clears rev_list in an
attempt to stop further "have" lines from being sent [1]. It is much
more readable to explicitly break from the loop instead.

So explicitly break from the loop, and make the clearing of the rev_list
happen unconditionally.

[1] The rationale is further described in the originating commit
f2cba9299b ("fetch-pack: Finish negotation if remote replies "ACK %s
ready"", 2011-03-14).

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fetch-pack.c