aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/fetch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-03-10 08:45:58 -0700
committerJunio C Hamano <gitster@pobox.com>2025-03-10 08:45:58 -0700
commit5d55ad01f500ddbb5b8d9c0fcf5123f63ff44ccd (patch)
tree7e095adcb925f90cb466ab5eeb9f5f6138c38c02 /builtin/fetch.c
parentMerge branch 'js/win-2.49-build-fixes' (diff)
parentfetch: fix following tags when fetching specific OID (diff)
downloadgit-5d55ad01f500ddbb5b8d9c0fcf5123f63ff44ccd.tar.gz
git-5d55ad01f500ddbb5b8d9c0fcf5123f63ff44ccd.zip
Merge branch 'tb/fetch-follow-tags-fix'
* tb/fetch-follow-tags-fix: fetch: fix following tags when fetching specific OID
Diffstat (limited to 'builtin/fetch.c')
-rw-r--r--builtin/fetch.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 1c740d5aac..95fd0018b9 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -1777,7 +1777,9 @@ static int do_fetch(struct transport *transport,
if (uses_remote_tracking(transport, rs)) {
must_list_refs = 1;
- strvec_push(&transport_ls_refs_options.ref_prefixes, "HEAD");
+ if (transport_ls_refs_options.ref_prefixes.nr)
+ strvec_push(&transport_ls_refs_options.ref_prefixes,
+ "HEAD");
}
if (must_list_refs) {