summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--project.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/project.py b/project.py
index cdce1e84..339f1a14 100644
--- a/project.py
+++ b/project.py
@@ -1973,7 +1973,7 @@ class Project(object):
1973 return False 1973 return False
1974 1974
1975 if os.path.exists(tmpPath): 1975 if os.path.exists(tmpPath):
1976 if curlret == 0 and self._IsValidBundle(tmpPath): 1976 if curlret == 0 and self._IsValidBundle(tmpPath, quiet):
1977 os.rename(tmpPath, dstPath) 1977 os.rename(tmpPath, dstPath)
1978 return True 1978 return True
1979 else: 1979 else:
@@ -1982,13 +1982,14 @@ class Project(object):
1982 else: 1982 else:
1983 return False 1983 return False
1984 1984
1985 def _IsValidBundle(self, path): 1985 def _IsValidBundle(self, path, quiet):
1986 try: 1986 try:
1987 with open(path) as f: 1987 with open(path) as f:
1988 if f.read(16) == '# v2 git bundle\n': 1988 if f.read(16) == '# v2 git bundle\n':
1989 return True 1989 return True
1990 else: 1990 else:
1991 print("Invalid clone.bundle file; ignoring.", file=sys.stderr) 1991 if not quiet:
1992 print("Invalid clone.bundle file; ignoring.", file=sys.stderr)
1992 return False 1993 return False
1993 except OSError: 1994 except OSError:
1994 return False 1995 return False