]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oeqa/utils/gitarchive: fix tag pattern searching
authorAlexis Lothoré <alexis.lothore@bootlin.com>
Tue, 10 Oct 2023 09:30:12 +0000 (11:30 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 11 Oct 2023 08:42:01 +0000 (09:42 +0100)
Whenever we ask gitarchive to search for tags, we can provide it with a
pattern (containing glob patterns). However, when searching for example for
tags matching branch master-next, it can find more tags which does not
correspond exactly to branch master-next (e.g. abelloni/master-next tags
will match).

Prevent those additional tags from being fetched by gitarchive by using a
more specific pattern: prefix user-provided pattern with "refs/tags"

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/utils/gitarchive.py

index f9c152681db7e8c73f8e1c91ad5e3f3f4ec8abba..2fe48cdcac7ff7ba38807b9cc525bec194bb35b0 100644 (file)
@@ -113,7 +113,7 @@ def get_tags(repo, log, pattern=None, url=None):
     # First try to fetch tags from repository configured remote
     cmd.append('origin')
     if pattern:
-        cmd.append(pattern)
+        cmd.append("refs/tags/"+pattern)
     try:
         tags_refs = repo.run_cmd(cmd)
         tags = ["".join(d.split()[1].split('/', 2)[2:]) for d in tags_refs.splitlines()]