diff options
| author | Chen Qi <Qi.Chen@windriver.com> | 2025-05-15 11:28:33 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-05-15 10:05:49 +0100 |
| commit | 89d2b3876d515f61c43990ec3e63269dce011f5e (patch) | |
| tree | 00af06744ac3703f432c4630ba481fed2304241f /bitbake | |
| parent | 07f08063c1d6eff52fe95d0b6c1239cb1336c7a7 (diff) | |
| download | poky-89d2b3876d515f61c43990ec3e63269dce011f5e.tar.gz | |
bitbake: lib/bb/tests/fetch: add a test case to ensure git shallow fetch works for tag containing slash
Add a test case to ensure git shallow fetch succeeds for SRC_URI
with tag containing slash.
For example, we want to succeed for SRC_URI like below:
SRC_URI = "git://salsa.debian.org/debian/debianutils.git;protocol=https;branch=master;tag=debian/${PV}"
See the following link for more information:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=15862
(Bitbake rev: 919d4cf6e688e67229c46d30c84d523b21936377)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
| -rw-r--r-- | bitbake/lib/bb/tests/fetch.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py index 0091723601..3f42332588 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py | |||
| @@ -2281,6 +2281,19 @@ class GitShallowTest(FetcherTest): | |||
| 2281 | self.assertRevCount(1) | 2281 | self.assertRevCount(1) |
| 2282 | assert os.path.exists(os.path.join(self.gitdir, '.git', 'shallow')) | 2282 | assert os.path.exists(os.path.join(self.gitdir, '.git', 'shallow')) |
| 2283 | 2283 | ||
| 2284 | def test_shallow_succeeds_with_tag_containing_slash(self): | ||
| 2285 | self.add_empty_file('a') | ||
| 2286 | self.add_empty_file('b') | ||
| 2287 | self.git('tag t1/t2/t3', cwd=self.srcdir) | ||
| 2288 | self.assertRevCount(2, cwd=self.srcdir) | ||
| 2289 | |||
| 2290 | srcrev = self.git('rev-parse HEAD', cwd=self.srcdir).strip() | ||
| 2291 | self.d.setVar('SRCREV', srcrev) | ||
| 2292 | uri = self.d.getVar('SRC_URI').split()[0] | ||
| 2293 | uri = '%s;tag=t1/t2/t3' % uri | ||
| 2294 | self.fetch_shallow(uri) | ||
| 2295 | self.assertRevCount(1) | ||
| 2296 | |||
| 2284 | class GitLfsTest(FetcherTest): | 2297 | class GitLfsTest(FetcherTest): |
| 2285 | def skipIfNoGitLFS(): | 2298 | def skipIfNoGitLFS(): |
| 2286 | if not shutil.which('git-lfs'): | 2299 | if not shutil.which('git-lfs'): |
