diff options
-rw-r--r-- | git_superproject.py | 2 | ||||
-rw-r--r-- | tests/test_git_superproject.py | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/git_superproject.py b/git_superproject.py index e2045cfd..157a1fbb 100644 --- a/git_superproject.py +++ b/git_superproject.py | |||
@@ -63,7 +63,7 @@ class Superproject(object): | |||
63 | True if 'git clone <url> <branch>' is successful, or False. | 63 | True if 'git clone <url> <branch>' is successful, or False. |
64 | """ | 64 | """ |
65 | os.mkdir(self._superproject_path) | 65 | os.mkdir(self._superproject_path) |
66 | cmd = ['clone', url, '--filter', 'blob:none'] | 66 | cmd = ['clone', url, '--depth', '1'] |
67 | if branch: | 67 | if branch: |
68 | cmd += ['--branch', branch] | 68 | cmd += ['--branch', branch] |
69 | p = GitCommand(None, | 69 | p = GitCommand(None, |
diff --git a/tests/test_git_superproject.py b/tests/test_git_superproject.py index 67a75a17..4012ec26 100644 --- a/tests/test_git_superproject.py +++ b/tests/test_git_superproject.py | |||
@@ -61,6 +61,13 @@ class SuperprojectTestCase(unittest.TestCase): | |||
61 | with mock.patch.object(self._superproject, '_Clone', return_value=False): | 61 | with mock.patch.object(self._superproject, '_Clone', return_value=False): |
62 | self._superproject.GetAllProjectsSHAs(url='localhost') | 62 | self._superproject.GetAllProjectsSHAs(url='localhost') |
63 | 63 | ||
64 | def test_superproject_get_project_shas_mock_pull(self): | ||
65 | """Test with _Pull failing.""" | ||
66 | with self.assertRaises(GitError): | ||
67 | with mock.patch.object(self._superproject, '_Clone', return_value=True): | ||
68 | with mock.patch.object(self._superproject, '_Pull', return_value=False): | ||
69 | self._superproject.GetAllProjectsSHAs(url='localhost') | ||
70 | |||
64 | def test_superproject_get_project_shas_mock_ls_tree(self): | 71 | def test_superproject_get_project_shas_mock_ls_tree(self): |
65 | """Test with LsTree being a mock.""" | 72 | """Test with LsTree being a mock.""" |
66 | data = ('120000 blob 158258bdf146f159218e2b90f8b699c4d85b5804\tAndroid.bp\x00' | 73 | data = ('120000 blob 158258bdf146f159218e2b90f8b699c4d85b5804\tAndroid.bp\x00' |