Kaynağa Gözat

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>
Shawn O. Pearce 17 yıl önce
ebeveyn
işleme
1fc99f4e47
1 değiştirilmiş dosya ile 5 ekleme ve 1 silme
  1. 5 1
      subcmds/init.py

+ 5 - 1
subcmds/init.py

@@ -124,7 +124,11 @@ default.xml will be used.
         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')