]> git.ipfire.org Git - thirdparty/git.git/commit
fetch: don't ask for remote HEAD if followRemoteHEAD is "never"
authorJeff King <peff@peff.net>
Tue, 18 Mar 2025 05:41:22 +0000 (01:41 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Mar 2025 19:21:26 +0000 (12:21 -0700)
commitaab0f899d9349bed824bf545b7398ab16c27a204
tree16eb4fbbc762473684498e3692822ec714c487d9
parentc834d1a7cef9b29d440af9369d253dab902238cb
fetch: don't ask for remote HEAD if followRemoteHEAD is "never"

When we are going to consider updating the refs/remotes/*/HEAD symref,
we have to ask the remote side where its HEAD points. But if we know
that the feature is disabled by config, we don't need to bother!

This saves a little bit of work and network communication for the
server. And even a little bit of effort on the client, as our local
set_head() function did a bit of work matching the remote HEAD before
realizing that we're not going to do anything with it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch.c
t/t5510-fetch.sh