diff options
-rw-r--r-- | bitbake/lib/bb/tests/fetch.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py index 701129d138..2ef2063436 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py | |||
@@ -2034,9 +2034,9 @@ class GitShallowTest(FetcherTest): | |||
2034 | self.add_empty_file('b') | 2034 | self.add_empty_file('b') |
2035 | self.git('checkout -b a_branch', cwd=self.srcdir) | 2035 | self.git('checkout -b a_branch', cwd=self.srcdir) |
2036 | self.add_empty_file('c') | 2036 | self.add_empty_file('c') |
2037 | self.git('tag v0.0 HEAD', cwd=self.srcdir) | ||
2037 | self.add_empty_file('d') | 2038 | self.add_empty_file('d') |
2038 | self.git('checkout master', cwd=self.srcdir) | 2039 | self.git('checkout master', cwd=self.srcdir) |
2039 | self.git('tag v0.0 a_branch', cwd=self.srcdir) | ||
2040 | self.add_empty_file('e') | 2040 | self.add_empty_file('e') |
2041 | self.git('merge --no-ff --no-edit a_branch', cwd=self.srcdir) | 2041 | self.git('merge --no-ff --no-edit a_branch', cwd=self.srcdir) |
2042 | self.add_empty_file('f') | 2042 | self.add_empty_file('f') |
@@ -2052,7 +2052,7 @@ class GitShallowTest(FetcherTest): | |||
2052 | 2052 | ||
2053 | self.fetch_shallow(uri) | 2053 | self.fetch_shallow(uri) |
2054 | 2054 | ||
2055 | self.assertRevCount(5) | 2055 | self.assertRevCount(4) |
2056 | self.assertRefs(['master', 'origin/master', 'origin/a_branch']) | 2056 | self.assertRefs(['master', 'origin/master', 'origin/a_branch']) |
2057 | 2057 | ||
2058 | def test_shallow_multi_one_uri_depths(self): | 2058 | def test_shallow_multi_one_uri_depths(self): |
@@ -2199,7 +2199,7 @@ class GitShallowTest(FetcherTest): | |||
2199 | 2199 | ||
2200 | self.fetch_shallow() | 2200 | self.fetch_shallow() |
2201 | 2201 | ||
2202 | self.assertRevCount(5) | 2202 | self.assertRevCount(2) |
2203 | 2203 | ||
2204 | def test_shallow_invalid_revs(self): | 2204 | def test_shallow_invalid_revs(self): |
2205 | self.add_empty_file('a') | 2205 | self.add_empty_file('a') |
@@ -2218,7 +2218,10 @@ class GitShallowTest(FetcherTest): | |||
2218 | self.git('tag v0.0 master', cwd=self.srcdir) | 2218 | self.git('tag v0.0 master', cwd=self.srcdir) |
2219 | self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0') | 2219 | self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0') |
2220 | self.d.setVar('BB_GIT_SHALLOW_REVS', 'v0.0') | 2220 | self.d.setVar('BB_GIT_SHALLOW_REVS', 'v0.0') |
2221 | self.fetch_shallow() | 2221 | |
2222 | with self.assertRaises(bb.fetch2.FetchError), self.assertLogs("BitBake.Fetcher", level="ERROR") as cm: | ||
2223 | self.fetch_shallow() | ||
2224 | self.assertIn("fatal: no commits selected for shallow requests", cm.output[0]) | ||
2222 | 2225 | ||
2223 | def test_shallow_fetch_missing_revs_fails(self): | 2226 | def test_shallow_fetch_missing_revs_fails(self): |
2224 | self.add_empty_file('a') | 2227 | self.add_empty_file('a') |
@@ -2249,7 +2252,7 @@ class GitShallowTest(FetcherTest): | |||
2249 | revs = len(self.git('rev-list master').splitlines()) | 2252 | revs = len(self.git('rev-list master').splitlines()) |
2250 | self.assertNotEqual(orig_revs, revs) | 2253 | self.assertNotEqual(orig_revs, revs) |
2251 | self.assertRefs(['master', 'origin/master']) | 2254 | self.assertRefs(['master', 'origin/master']) |
2252 | self.assertRevCount(orig_revs - 1758) | 2255 | self.assertRevCount(orig_revs - 1760) |
2253 | 2256 | ||
2254 | def test_that_unpack_throws_an_error_when_the_git_clone_nor_shallow_tarball_exist(self): | 2257 | def test_that_unpack_throws_an_error_when_the_git_clone_nor_shallow_tarball_exist(self): |
2255 | self.add_empty_file('a') | 2258 | self.add_empty_file('a') |