]> Kevux Git Server - rit/commit
check_connected(): delay opening new_pack
authorJeff King <peff@peff.net>
Thu, 5 Mar 2026 23:08:54 +0000 (18:08 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 6 Mar 2026 21:51:03 +0000 (13:51 -0800)
commit26b974b3a9608adee6f964e9effbac86d0220bc3
treef610432c72dc086c7a51043caa564c0334b6f80c
parent67ad42147a7acc2af6074753ebd03d904476118f
check_connected(): delay opening new_pack

In check_connected(), if the transport tells us we got a single packfile
that has already been verified as self-contained and connected, then we
can skip checking connectivity for any tips that are mentioned in that
pack. This goes back to c6807a40dc (clone: open a shortcut for
connectivity check, 2013-05-26).

We don't need to open that pack until we are about to start sending oids
to our child rev-list process, since that's when we check whether they
are in the self-contained pack. Let's push the opening of that pack
further down in the function. That saves us from having to clean it up
when we leave the function early (and by the time have opened the
rev-list process, we never leave the function early, since we have to
clean up the child process).

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
connected.c