Skip to content

Commit 41eb581

Browse files
author
Roberto Vladimir Prado Carranza
committed
fix: Using --depth on manifest that includes submanifest results in error during repo sync
Signed-off-by: guillaume.micouin-jorda [email protected] Signed-off-by: [email protected]
1 parent d2abe50 commit 41eb581

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

repo/project.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -3952,14 +3952,17 @@ def _ConfigureDepth(self, depth):
39523952
"""
39533953
# Opt.depth will be non-None if user actually passed --depth to repo init.
39543954
if depth is not None:
3955-
if depth > 0:
3956-
# Positive values will set the depth.
3957-
depth = str(depth)
3958-
else:
3959-
# Negative numbers will clear the depth; passing None to SetString
3960-
# will do that.
3961-
depth = None
3962-
3955+
try:
3956+
if int(depth) > 0:
3957+
# Positive values will set the depth.
3958+
depth = str(depth)
3959+
else:
3960+
# Negative numbers will clear the depth; passing None to SetString
3961+
# will do that.
3962+
depth = None
3963+
except ValueError:
3964+
depth = None
3965+
_warn("depth: invalid integer value: '%s'", depth)
39633966
# We store the depth in the main manifest project.
39643967
self.config.SetString('repo.depth', depth)
39653968

0 commit comments

Comments
 (0)