From d744eb15f38b9351463900babffd732994e3a046 Mon Sep 17 00:00:00 2001 From: Brian Gan Date: Wed, 21 Oct 2026 22:36:15 +0000 Subject: [PATCH] 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 Reviewed-by: Gavin Mak Commit-Queue: Brian Gan --- project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.py b/project.py index f98d293e5..6a186aa1d 100644 --- a/project.py +++ b/project.py @@ -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: