瀏覽代碼

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 年之前
父節點
當前提交
1fc99f4e47
共有 1 個文件被更改,包括 5 次插入1 次删除
  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')