diff options
author | Jonathan Tan <jonathantanmy@google.com> | 2019-08-21 15:20:09 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-08-22 14:20:35 -0700 |
commit | ac3fda82bfe1c9e99c5838d052c678c78139ee34 (patch) | |
tree | d25670cb823e968103065070b0e6c6c207d99c42 /sha1collisiondetection | |
parent | First batch after Git 2.23 (diff) | |
download | tgif-ac3fda82bfe1c9e99c5838d052c678c78139ee34.tar.xz |
transport-helper: skip ls-refs if unnecessary
Commit e70a3030e7 ("fetch: do not list refs if fetching only hashes",
2018-10-07) and its ancestors taught Git, as an optimization, to skip
the ls-refs step when it is not necessary during a protocol v2 fetch
(for example, when lazy fetching a missing object in a partial clone, or
when running "git fetch --no-tags <remote> <SHA-1>"). But that was only
done for natively supported protocols; in particular, HTTP was not
supported.
Teach Git to skip ls-refs when using remote helpers that support connect
or stateless-connect. To do this, fetch() is made an acceptable entry
point. Because fetch() can now be the first function in the vtable
called, "get_helper(transport);" has to be added to the beginning of
that function to set the transport up (if not yet set up) before
process_connect() is invoked.
When fetch() is called, the transport could be taken over (this happens
if "connect" or "stateless-connect" is successfully run without any
"fallback" response), or not. If the transport is taken over, execution
continues like execution for natively supported protocols
(fetch_refs_via_pack() is executed, which will fetch refs using ls-refs
if needed). If not, the remote helper interface will invoke
get_refs_list() if it hasn't been invoked yet, preserving existing
behavior.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1collisiondetection')
0 files changed, 0 insertions, 0 deletions