diff options
Diffstat (limited to 'bitbake/lib/bb/tests/fetch.py')
-rw-r--r-- | bitbake/lib/bb/tests/fetch.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py index 311c70137e..5fb5d04cb0 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py | |||
@@ -1316,6 +1316,7 @@ class GitShallowTest(FetcherTest): | |||
1316 | # fetch and unpack, from the shallow tarball | 1316 | # fetch and unpack, from the shallow tarball |
1317 | bb.utils.remove(self.gitdir, recurse=True) | 1317 | bb.utils.remove(self.gitdir, recurse=True) |
1318 | bb.utils.remove(ud.clonedir, recurse=True) | 1318 | bb.utils.remove(ud.clonedir, recurse=True) |
1319 | bb.utils.remove(ud.clonedir.replace('gitsource', 'gitsubmodule'), recurse=True) | ||
1319 | 1320 | ||
1320 | # confirm that the unpacked repo is used when no git clone or git | 1321 | # confirm that the unpacked repo is used when no git clone or git |
1321 | # mirror tarball is available | 1322 | # mirror tarball is available |
@@ -1470,6 +1471,7 @@ class GitShallowTest(FetcherTest): | |||
1470 | self.git('config --add remote.origin.url "%s"' % smdir, cwd=smdir) | 1471 | self.git('config --add remote.origin.url "%s"' % smdir, cwd=smdir) |
1471 | self.git('config --add remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"', cwd=smdir) | 1472 | self.git('config --add remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"', cwd=smdir) |
1472 | self.add_empty_file('asub', cwd=smdir) | 1473 | self.add_empty_file('asub', cwd=smdir) |
1474 | self.add_empty_file('bsub', cwd=smdir) | ||
1473 | 1475 | ||
1474 | self.git('submodule init', cwd=self.srcdir) | 1476 | self.git('submodule init', cwd=self.srcdir) |
1475 | self.git('submodule add file://%s' % smdir, cwd=self.srcdir) | 1477 | self.git('submodule add file://%s' % smdir, cwd=self.srcdir) |
@@ -1479,10 +1481,16 @@ class GitShallowTest(FetcherTest): | |||
1479 | uri = 'gitsm://%s;protocol=file;subdir=${S}' % self.srcdir | 1481 | uri = 'gitsm://%s;protocol=file;subdir=${S}' % self.srcdir |
1480 | fetcher, ud = self.fetch_shallow(uri) | 1482 | fetcher, ud = self.fetch_shallow(uri) |
1481 | 1483 | ||
1484 | # Verify the main repository is shallow | ||
1482 | self.assertRevCount(1) | 1485 | self.assertRevCount(1) |
1483 | assert './.git/modules/' in bb.process.run('tar -tzf %s' % os.path.join(self.dldir, ud.mirrortarballs[0]))[0] | 1486 | |
1487 | # Verify the gitsubmodule directory is present | ||
1484 | assert os.listdir(os.path.join(self.gitdir, 'gitsubmodule')) | 1488 | assert os.listdir(os.path.join(self.gitdir, 'gitsubmodule')) |
1485 | 1489 | ||
1490 | # Verify the submodule is also shallow | ||
1491 | self.assertRevCount(1, cwd=os.path.join(self.gitdir, 'gitsubmodule')) | ||
1492 | |||
1493 | |||
1486 | if any(os.path.exists(os.path.join(p, 'git-annex')) for p in os.environ.get('PATH').split(':')): | 1494 | if any(os.path.exists(os.path.join(p, 'git-annex')) for p in os.environ.get('PATH').split(':')): |
1487 | def test_shallow_annex(self): | 1495 | def test_shallow_annex(self): |
1488 | self.add_empty_file('a') | 1496 | self.add_empty_file('a') |