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 <vapier@google.com>
Tested-by: Gavin Mak <gavinmak@google.com>
diff --git a/subcmds/init.py b/subcmds/init.py
index 26cac62..813fa59 100644
--- a/subcmds/init.py
+++ b/subcmds/init.py
@@ -218,16 +218,14 @@
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 @@
self._ConfigureUser(opt)
self._ConfigureColor()
- self._DisplayResult(opt)
+ if not opt.quiet:
+ self._DisplayResult()