Skip to content

Commit

Permalink
Merge pull request #26 from robertopradoc/setuppy
Browse files Browse the repository at this point in the history
fix: cast of depth parameter when using submanifest
  • Loading branch information
ssavrim authored Sep 13, 2023
2 parents d2abe50 + 41eb581 commit 232d505
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions repo/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -3952,14 +3952,17 @@ def _ConfigureDepth(self, depth):
"""
# Opt.depth will be non-None if user actually passed --depth to repo init.
if depth is not None:
if depth > 0:
# Positive values will set the depth.
depth = str(depth)
else:
# Negative numbers will clear the depth; passing None to SetString
# will do that.
depth = None

try:
if int(depth) > 0:
# Positive values will set the depth.
depth = str(depth)
else:
# Negative numbers will clear the depth; passing None to SetString
# will do that.
depth = None
except ValueError:
depth = None
_warn("depth: invalid integer value: '%s'", depth)
# We store the depth in the main manifest project.
self.config.SetString('repo.depth', depth)

Expand Down

0 comments on commit 232d505

Please sign in to comment.