mirror of
https://gerrit.googlesource.com/git-repo
synced 2026-01-12 01:20:26 +00:00
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:
@@ -2579,7 +2579,7 @@ class Project:
|
|||||||
effective_depth = (
|
effective_depth = (
|
||||||
self.clone_depth or self.manifest.manifestProject.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")
|
cmd.append("--no-auto-gc")
|
||||||
|
|
||||||
if not verbose:
|
if not verbose:
|
||||||
|
|||||||
@@ -1437,6 +1437,12 @@ later is required to fix a server side protocol bug.
|
|||||||
run 'git count-objects -v' and warn if the repository is accumulating
|
run 'git count-objects -v' and warn if the repository is accumulating
|
||||||
excessive pack files or garbage.
|
excessive pack files or garbage.
|
||||||
"""
|
"""
|
||||||
|
# We only care about bloated projects if we have a git version that
|
||||||
|
# supports --no-auto-gc (2.23.0+) since what we use to disable auto-gc
|
||||||
|
# in Project._RemoteFetch.
|
||||||
|
if not git_require((2, 23, 0)):
|
||||||
|
return
|
||||||
|
|
||||||
projects = [p for p in projects if p.clone_depth]
|
projects = [p for p in projects if p.clone_depth]
|
||||||
if not projects:
|
if not projects:
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user