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>
This commit is contained in:
Shawn O. Pearce 2009-03-17 08:06:18 -07:00
parent 1775dbe176
commit 1fc99f4e47

View File

@ -124,7 +124,11 @@ default.xml will be used.
print >>sys.stderr, 'fatal: --mirror not supported on existing client' print >>sys.stderr, 'fatal: --mirror not supported on existing client'
sys.exit(1) 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() m.Sync_LocalHalf()
if is_new: if is_new:
m.StartBranch('default') m.StartBranch('default')