File tree 1 file changed +11
-8
lines changed
1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -3952,14 +3952,17 @@ def _ConfigureDepth(self, depth):
3952
3952
"""
3953
3953
# Opt.depth will be non-None if user actually passed --depth to repo init.
3954
3954
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 )
3963
3966
# We store the depth in the main manifest project.
3964
3967
self .config .SetString ('repo.depth' , depth )
3965
3968
You can’t perform that action at this time.
0 commit comments