]> git.ipfire.org Git - thirdparty/git.git/commit
clone: add tags refspec earlier to fetch refspec
authorToon Claes <toon@iotcl.com>
Thu, 6 Feb 2025 06:33:32 +0000 (07:33 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 6 Feb 2025 20:23:53 +0000 (12:23 -0800)
commit2ca67c6f1433586e61487295bb04cc424992db12
tree2247faa75f7a3d8ce3601a892859da447df367f5
parent879780f9a15177ed703f56bf347e0a410c22e9d1
clone: add tags refspec earlier to fetch refspec

In clone.c we call refspec_ref_prefixes() to copy the fetch refspecs
from the `remote->fetch` refspec into `ref_prefixes` of
`transport_ls_refs_options`. Afterwards we add the tags prefix
`refs/tags/` prefix as well. At a later point, in wanted_peer_refs() we
process refs using both `remote->fetch` and `TAG_REFSPEC`.

Simplify the code by appending `TAG_REFSPEC` to `remote->fetch` before
calling refspec_ref_prefixes().

To be able to do this, we set `option_tags` to 0 when --mirror is given.
This is because --mirror mirrors (hence the name) all the refs,
including tags and they do not need to be treated separately.

Signed-off-by: Toon Claes <toon@iotcl.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/clone.c