From 7f44d366d016039c32c374db27e9956919fe2dfb Mon Sep 17 00:00:00 2001 From: LaMont Jones Date: Tue, 31 Jan 2023 22:13:24 +0000 Subject: [PATCH] project: clean up error message Superproject update failures on single-manifest checkouts had an extra space. Bug: b/254523816 Change-Id: I6f71e42337e324a6975c5d6bba487f83abaf054f Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/357056 Tested-by: LaMont Jones Reviewed-by: Xin Li --- project.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/project.py b/project.py index 996fc02e..3ccfd140 100644 --- a/project.py +++ b/project.py @@ -3932,12 +3932,14 @@ class ManifestProject(MetaProject): if git_superproject.UseSuperproject(use_superproject, self.manifest): sync_result = self.manifest.superproject.Sync(git_event_log) if not sync_result.success: - print('warning: git update of superproject for ' - f'{self.manifest.path_prefix} failed, repo sync will not use ' - 'superproject to fetch source; while this error is not fatal, ' - 'and you can continue to run repo sync, please run repo init ' - 'with the --no-use-superproject option to stop seeing this ' - 'warning', file=sys.stderr) + submanifest = '' + if self.manifest.path_prefix: + submanifest = f'for {self.manifest.path_prefix} ' + print(f'warning: git update of superproject {submanifest}failed, repo ' + 'sync will not use superproject to fetch source; while this ' + 'error is not fatal, and you can continue to run repo sync, ' + 'please run repo init with the --no-use-superproject option to ' + 'stop seeing this warning', file=sys.stderr) if sync_result.fatal and use_superproject is not None: return False