project: only use --no-auto-gc for git 2.23.0+

The flag for git fetch was introduced in git 2.23.0. Also skip the bloat
check after sync if using an older version.

Bug: 468589976
Bug: 379111283
Change-Id: Ib53e5494350c71a83906e5219d3a8c2b654e531f
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/536082
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: Gavin Mak <gavinmak@google.com>
This commit is contained in:
Gavin Mak
2025-12-15 18:49:13 +00:00
committed by LUCI
parent b5991d7128
commit 5b0b5513d6
2 changed files with 7 additions and 1 deletions

View File

@@ -2579,7 +2579,7 @@ class Project:
effective_depth = (
self.clone_depth or self.manifest.manifestProject.depth
)
if effective_depth == 1:
if effective_depth == 1 and git_require((2, 23, 0)):
cmd.append("--no-auto-gc")
if not verbose: