diff --git a/project.py b/project.py index c91ae217..93d9dcba 100644 --- a/project.py +++ b/project.py @@ -3982,7 +3982,7 @@ class ManifestProject(MetaProject): @property def depth(self): """Partial clone depth.""" - return self.config.GetString("repo.depth") + return self.config.GetInt("repo.depth") @property def clone_filter(self): diff --git a/tests/test_project.py b/tests/test_project.py index 42f0f6e5..83cfe0a4 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -507,7 +507,10 @@ class ManifestPropertiesFetchedCorrectly(unittest.TestCase): self.assertFalse(fakeproj.partial_clone) fakeproj.config.SetString("repo.depth", "48") - self.assertEqual(fakeproj.depth, "48") + self.assertEqual(fakeproj.depth, 48) + + fakeproj.config.SetString("repo.depth", "invalid_depth") + self.assertEqual(fakeproj.depth, None) fakeproj.config.SetString("repo.clonefilter", "blob:limit=10M") self.assertEqual(fakeproj.clone_filter, "blob:limit=10M")