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.