summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGavin Mak <gavinmak@google.com>2023-01-06 01:03:32 +0000
committerGavin Mak <gavinmak@google.com>2023-01-06 16:01:52 +0000
commitc3d61ec2529790bb690071e229511cc641cea5ad (patch)
treed61178d6ab7745db8fa4c784c20aa4ccf0ac988a
parent78e82ec78e9bd4677c2e1f941b046d126f2f0ba7 (diff)
downloadgit-repo-c3d61ec2529790bb690071e229511cc641cea5ad.tar.gz
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>
-rw-r--r--subcmds/init.py11
1 files 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.
218 if a in ('y', 'yes', 't', 'true', 'on'): 218 if a in ('y', 'yes', 't', 'true', 'on'):
219 gc.SetString('color.ui', 'auto') 219 gc.SetString('color.ui', 'auto')
220 220
221 def _DisplayResult(self, opt): 221 def _DisplayResult(self):
222 if self.manifest.IsMirror: 222 if self.manifest.IsMirror:
223 init_type = 'mirror ' 223 init_type = 'mirror '
224 else: 224 else:
225 init_type = '' 225 init_type = ''
226 226
227 if not opt.quiet: 227 print()
228 print() 228 print('repo %shas been initialized in %s' % (init_type, self.manifest.topdir))
229 print('repo %shas been initialized in %s' %
230 (init_type, self.manifest.topdir))
231 229
232 current_dir = os.getcwd() 230 current_dir = os.getcwd()
233 if current_dir != self.manifest.topdir: 231 if current_dir != self.manifest.topdir:
@@ -317,4 +315,5 @@ to update the working directory files.
317 self._ConfigureUser(opt) 315 self._ConfigureUser(opt)
318 self._ConfigureColor() 316 self._ConfigureColor()
319 317
320 self._DisplayResult(opt) 318 if not opt.quiet:
319 self._DisplayResult()