bitbake: fetch/git: Ensure tags work with shallow clones

If we want to validate a tag when using shallow clones, we need to ensure
the tag is imported to the clone. Adding to extra_refs allows this to happen
ensuring tag validation in shallow clones works.

(Bitbake rev: 03945475886b8d31c7eccc80fe594ab5306bcf5d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2025-03-18 12:14:46 +00:00
parent 18a533bfe6
commit b56a335481

View File

@@ -674,6 +674,8 @@ class Git(FetchMethod):
for line in all_refs_remote:
all_refs.append(line.split()[-1])
extra_refs = []
if 'tag' in ud.parm:
extra_refs.append(ud.parm['tag'])
for r in ud.shallow_extra_refs:
if not ud.bareclone:
r = r.replace('refs/heads/', 'refs/remotes/origin/')