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 <roberto.prado.c@gmail.com>
Signed-off-by: Guillaume Micouin-Jorda <gmicouin@netcourrier.com>
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/385995
Commit-Queue: Mike Frysinger <vapier@google.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
Reviewed-by: Jerome Couto <jerome.couto@renault.com>
This commit is contained in:
Roberto Vladimir Prado Carranza 2023-09-13 10:27:26 +02:00 committed by LUCI
parent c0aad7de18
commit 3d58d219cb
2 changed files with 5 additions and 2 deletions

View File

@ -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):

View File

@ -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")