From c3d61ec2529790bb690071e229511cc641cea5ad Mon Sep 17 00:00:00 2001 From: Gavin Mak Date: Fri, 6 Jan 2023 01:03:32 +0000 Subject: [PATCH] init: Silence the "rm -r .repo and try again" message if quiet Bug: b/258532367 Change-Id: I53a23aa0b237b0bb5f7e58464936f8c9b0db1311 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/355915 Reviewed-by: Mike Frysinger Tested-by: Gavin Mak --- subcmds/init.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/subcmds/init.py b/subcmds/init.py index 26cac62f..813fa590 100644 --- a/subcmds/init.py +++ b/subcmds/init.py @@ -218,16 +218,14 @@ to update the working directory files. if a in ('y', 'yes', 't', 'true', 'on'): gc.SetString('color.ui', 'auto') - def _DisplayResult(self, opt): + def _DisplayResult(self): if self.manifest.IsMirror: init_type = 'mirror ' else: init_type = '' - if not opt.quiet: - print() - print('repo %shas been initialized in %s' % - (init_type, self.manifest.topdir)) + print() + print('repo %shas been initialized in %s' % (init_type, self.manifest.topdir)) current_dir = os.getcwd() if current_dir != self.manifest.topdir: @@ -317,4 +315,5 @@ to update the working directory files. self._ConfigureUser(opt) self._ConfigureColor() - self._DisplayResult(opt) + if not opt.quiet: + self._DisplayResult()