Re: [PATCH] Fix `git fetch --tags` in repo with no configured remote
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 6, 2024, 03:07 UTC
- Message-ID
- <xmqqo71pzeyc.fsf@gitster.g>
- In-Reply-To
- <b41ae080654a3603af09801018df539f656cf9d8.1733430345.git.steadmon@google.com>
Josh Steadmon <steadmon@google.com> writes:
Show 15 quoted lines
> 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 <steadmon@google.com> > --- > 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.