Fix repo re-init in a mirror to not prompt
On a mirror client we don't prompt for user.name,user.email as the
data is only necessary if you will make new commits. On a re-init
we were testing the command line option, not the existing IsMirror
property from the manifest configuration file.
Signed-off-by: Shawn O. Pearce <sop@google.com>
diff --git a/subcmds/init.py b/subcmds/init.py
index 83ed2b6..d86c49a 100644
--- a/subcmds/init.py
+++ b/subcmds/init.py
@@ -202,11 +202,11 @@
self._SyncManifest(opt)
self._LinkManifest(opt.manifest_name)
- if os.isatty(0) and os.isatty(1) and not opt.mirror:
+ if os.isatty(0) and os.isatty(1) and not self.manifest.IsMirror:
self._ConfigureUser()
self._ConfigureColor()
- if opt.mirror:
+ if self.manifest.IsMirror:
type = 'mirror '
else:
type = ''