mirror of
https://gerrit.googlesource.com/git-repo
synced 2026-10-22 21:28:24 +00:00
project: accept v3 git bundles in _IsValidBundle
Git 2.29+ introduced v3 bundle headers (`# v3 git bundle`) for SHA-256 and filtered bundles. Allow both v2 and v3 bundle headers when validating downloaded `clone.bundle` files. Bug: 576377949 Change-Id: Ic5ac94bf535a801d948f8932213e62a6cd132cac Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/647123 Tested-by: Brian Gan <brgan@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Brian Gan <brgan@google.com>
This commit is contained in:
1 parent
f0124d0fd5
commit
d744eb15f3
1 file changed
+1
-1
+1
-1
@@ -3874,7 +3874,7 @@ class Project:
|
||||
def _IsValidBundle(self, path, quiet):
|
||||
try:
|
||||
with open(path, "rb") as f:
|
||||
if f.read(16) == b"# v2 git bundle\n":
|
||||
if f.read(16) in (b"# v2 git bundle\n", b"# v3 git bundle\n"):
|
||||
return True
|
||||
else:
|
||||
if not quiet:
|
||||
|
||||
Reference in new issue
Block a user