summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2025-01-24 08:08:44 -0800
committerSteve Sakoman <steve@sakoman.com>2025-01-29 06:20:43 -0800
commitd3a9774876585eefab9d904be4f16e0f878a0f25 (patch)
treea1c9cdde3004d62a19a58cae9b61f026ef7774d0
parentff9ca74e170480578fcdb1f7bcd897f0e69e46a5 (diff)
downloadpoky-d3a9774876585eefab9d904be4f16e0f878a0f25.tar.gz
bitbake: tests/fetch: Fix git shallow test failure with git >= 2.48
>From git 2.48 release notes: """ When "git fetch $remote" notices that refs/remotes/$remote/HEAD is missing and discovers what branch the other side points with its HEAD, refs/remotes/$remote/HEAD is updated to point to it. """ This means with git 2.48 onwards, there is a mystery "HEAD" revision appearing in some of our shallow clone tests. We can avoid this by using the same canonicalization as used for the reference revisions. This resolves autobuilder failures on the Fedora 40 workers. (Bitbake rev: f4b2ae97a8dd745b463e5e10fbc8d30d29d223c5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit c83444d1210740e27b1744d3aa7c5cad4e28db2f) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--bitbake/lib/bb/tests/fetch.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py
index 363f3a2185..68b2dbba96 100644
--- a/bitbake/lib/bb/tests/fetch.py
+++ b/bitbake/lib/bb/tests/fetch.py
@@ -1739,6 +1739,8 @@ class GitShallowTest(FetcherTest):
1739 if cwd is None: 1739 if cwd is None:
1740 cwd = self.gitdir 1740 cwd = self.gitdir
1741 actual_refs = self.git(['for-each-ref', '--format=%(refname)'], cwd=cwd).splitlines() 1741 actual_refs = self.git(['for-each-ref', '--format=%(refname)'], cwd=cwd).splitlines()
1742 # Resolve references into the same format as the comparision (needed by git 2.48 onwards)
1743 actual_refs = self.git(['rev-parse', '--symbolic-full-name'] + actual_refs, cwd=cwd).splitlines()
1742 full_expected = self.git(['rev-parse', '--symbolic-full-name'] + expected_refs, cwd=cwd).splitlines() 1744 full_expected = self.git(['rev-parse', '--symbolic-full-name'] + expected_refs, cwd=cwd).splitlines()
1743 self.assertEqual(sorted(set(full_expected)), sorted(set(actual_refs))) 1745 self.assertEqual(sorted(set(full_expected)), sorted(set(actual_refs)))
1744 1746