Thread (1 message) 1 message, 1 author, 2024-12-06

Re: [PATCH] Fix `git fetch --tags` in repo with no configured remote

From: Junio C Hamano <hidden>
Date: 2024-12-06 03:07:58

Josh Steadmon [off-list ref] writes:
In 3f763ddf28 (fetch: set remote/HEAD if it does not exist, 2024-11-22),
git-fetch learned to opportunistically set $REMOTE/HEAD when fetching.
However, this broke the logic for the `--tags` flag. Specifically, we
now unconditionally add HEAD to the ref_prefixes list, but we did this
*after* deciding whether we also need to explicitly request tags.

Fix this by adding HEAD to the ref_prefixes list prior to handling the
`--tags` flag, and removing the now obsolete check whether ref_prefixes
is empty or not.

Signed-off-by: Josh Steadmon <redacted>
---
 builtin/fetch.c  |  9 ++++-----
 t/t5510-fetch.sh | 17 +++++++++++++++++
 2 files changed, 21 insertions(+), 5 deletions(-)
I see Bence is happy with the fix in a nearby message, so let me
queue (and perhaps later amend it with Acked-by from Bence if we see
one) the fix.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help