From 41eb581667d592c83e8b77867bc6262123e94f43 Mon Sep 17 00:00:00 2001 From: Roberto Vladimir Prado Carranza Date: Wed, 13 Sep 2023 09:58:01 +0200 Subject: [PATCH] fix: Using --depth on manifest that includes submanifest results in error during repo sync Signed-off-by: guillaume.micouin-jorda guillaume.micouin-jorda@renault.com Signed-off-by: roberto-vladimir.prado-carranza@renault.com --- repo/project.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/repo/project.py b/repo/project.py index 8087352..d4a6130 100644 --- a/repo/project.py +++ b/repo/project.py @@ -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)