diff --git a/git_superproject.py b/git_superproject.py index e2045cf..157a1fb 100644 --- a/git_superproject.py +++ b/git_superproject.py @@ -63,7 +63,7 @@ class Superproject(object): True if 'git clone ' is successful, or False. """ os.mkdir(self._superproject_path) - cmd = ['clone', url, '--filter', 'blob:none'] + cmd = ['clone', url, '--depth', '1'] if branch: cmd += ['--branch', branch] p = GitCommand(None, diff --git a/tests/test_git_superproject.py b/tests/test_git_superproject.py index 67a75a1..4012ec2 100644 --- a/tests/test_git_superproject.py +++ b/tests/test_git_superproject.py @@ -61,6 +61,13 @@ class SuperprojectTestCase(unittest.TestCase): with mock.patch.object(self._superproject, '_Clone', return_value=False): self._superproject.GetAllProjectsSHAs(url='localhost') + def test_superproject_get_project_shas_mock_pull(self): + """Test with _Pull failing.""" + with self.assertRaises(GitError): + with mock.patch.object(self._superproject, '_Clone', return_value=True): + with mock.patch.object(self._superproject, '_Pull', return_value=False): + self._superproject.GetAllProjectsSHAs(url='localhost') + def test_superproject_get_project_shas_mock_ls_tree(self): """Test with LsTree being a mock.""" data = ('120000 blob 158258bdf146f159218e2b90f8b699c4d85b5804\tAndroid.bp\x00'