bitbake: fetch2/git: Handle srcrevs for annotated tags in tag check

If SRCREV points at an annotated tag, the comparision code can fail
as the resolved tag might not be the same sha.

Handle this by also resolving the SRCREV. We only need to do this if
they don't match in the first place for a minor performance win.

Also add a test for this.

(Bitbake rev: 136c06e251de68ed64355ec6b47a522ff3a372e3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2025-04-02 09:00:13 +01:00
parent efe76a5095
commit 49ec431d95
2 changed files with 13 additions and 1 deletions

View File

@@ -3139,6 +3139,13 @@ class GitTagVerificationTests(FetcherTest):
fetcher.download()
fetcher.unpack(self.unpackdir)
def test_annotated_tag_rev_match(self):
# Test a url with rev= and tag= set works
# rev is the annotated tag revision in this case
fetcher = bb.fetch.Fetch(["git://git.openembedded.org/bitbake;branch=2.8;protocol=https;rev=6d363159e4b7dc566fc40d069b2615e61774a7d8;tag=2.8.7"], self.d)
fetcher.download()
fetcher.unpack(self.unpackdir)
@skipIfNoNetwork()
def test_tag_rev_match2(self):
# Test a url with SRCREV and tag= set works