From 3d58d219cbdf046677f8e88c488e085660488f06 Mon Sep 17 00:00:00 2001 From: Roberto Vladimir Prado Carranza Date: Wed, 13 Sep 2023 10:27:26 +0200 Subject: [PATCH] project: using --depth results in error when including submanifests Fix: https://issues.gerritcodereview.com/issues/40015442 Change-Id: I7fb6c50cf2e438b21181ce1a5893885f09b9ee2b Signed-off-by: Roberto Vladimir Prado Carranza Signed-off-by: Guillaume Micouin-Jorda Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/385995 Commit-Queue: Mike Frysinger Reviewed-by: Mike Frysinger Reviewed-by: Jerome Couto --- project.py | 2 +- tests/test_project.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) 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")