diff mbox series

[1/2] fetch2/git: Improve shallow clone tag fetching

Message ID 20250625200036.3148793-1-richard.purdie@linuxfoundation.org
State New
Headers show
Series [1/2] fetch2/git: Improve shallow clone tag fetching | expand

Commit Message

Richard Purdie June 25, 2025, 8 p.m. UTC
Currently, tags are fetched as just a name, which works but means they're not
seen as tags by git commands like git describe. Instead, fetch them as refs/tags/XXX
which means such commands then work correctly.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/fetch2/git.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 0af8070080b..e7b030998c0 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -634,7 +634,7 @@  class Git(FetchMethod):
             all_refs.append(line.split()[-1])
         extra_refs = []
         if 'tag' in ud.parm:
-            extra_refs.append(ud.parm['tag'])
+            extra_refs.append("refs/tags/" + ud.parm['tag'])
         for r in ud.shallow_extra_refs:
             if not ud.bareclone:
                 r = r.replace('refs/heads/', 'refs/remotes/origin/')