Give a more friendly error in 'repo init' if manifest url is invalid
Instead of a stack trace ending in origin/master not existing we
now tell the user the manifest url is invalid if 'git fetch' has
failed out early.
Signed-off-by: Shawn O. Pearce <sop@google.com>
diff --git a/subcmds/init.py b/subcmds/init.py
index 937296b..04de48a 100644
--- a/subcmds/init.py
+++ b/subcmds/init.py
@@ -124,7 +124,11 @@
print >>sys.stderr, 'fatal: --mirror not supported on existing client'
sys.exit(1)
- m.Sync_NetworkHalf()
+ if not m.Sync_NetworkHalf():
+ r = m.GetRemote(m.remote.name)
+ print >>sys.stderr, 'fatal: cannot obtain manifest %s' % r.url
+ sys.exit(1)
+
m.Sync_LocalHalf()
if is_new:
m.StartBranch('default')