|
@@ -1973,7 +1973,7 @@ class Project(object):
|
|
|
return False
|
|
return False
|
|
|
|
|
|
|
|
if os.path.exists(tmpPath):
|
|
if os.path.exists(tmpPath):
|
|
|
- if curlret == 0 and self._IsValidBundle(tmpPath):
|
|
|
|
|
|
|
+ if curlret == 0 and self._IsValidBundle(tmpPath, quiet):
|
|
|
os.rename(tmpPath, dstPath)
|
|
os.rename(tmpPath, dstPath)
|
|
|
return True
|
|
return True
|
|
|
else:
|
|
else:
|
|
@@ -1982,13 +1982,14 @@ class Project(object):
|
|
|
else:
|
|
else:
|
|
|
return False
|
|
return False
|
|
|
|
|
|
|
|
- def _IsValidBundle(self, path):
|
|
|
|
|
|
|
+ def _IsValidBundle(self, path, quiet):
|
|
|
try:
|
|
try:
|
|
|
with open(path) as f:
|
|
with open(path) as f:
|
|
|
if f.read(16) == '# v2 git bundle\n':
|
|
if f.read(16) == '# v2 git bundle\n':
|
|
|
return True
|
|
return True
|
|
|
else:
|
|
else:
|
|
|
- print("Invalid clone.bundle file; ignoring.", file=sys.stderr)
|
|
|
|
|
|
|
+ if not quiet:
|
|
|
|
|
+ print("Invalid clone.bundle file; ignoring.", file=sys.stderr)
|
|
|
return False
|
|
return False
|
|
|
except OSError:
|
|
except OSError:
|
|
|
return False
|
|
return False
|