From 8d5f03261164f3cd65af0576dfa7d4edded96c67 Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Wed, 5 Feb 2025 19:35:45 +0000 Subject: [PATCH] gc: Add tags to remote pack list If tags are omitted from the remote pack list, they must be present in local pack. However, local packs don't have promisor objects, meaning that all blobs must be available locally, and therefore all missing blobs will be downloaded during rev-list phase. Git downloads those sequentially, by invokving fetch operation (rev-list/fetch). Instead of downloading tags' blobs, instruct Git to include all tags in remote rev-list operation. This change was tested with `git fsck --all`. R=yiwzhang@google.com Bug: b/392732561 Change-Id: Id94a40aebbe4f084c952329583d559d296db1a11 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/451422 Reviewed-by: Yiwei Zhang Tested-by: Josip Sokcevic Commit-Queue: Josip Sokcevic --- subcmds/gc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subcmds/gc.py b/subcmds/gc.py index 0831dc3c..4e5bcabf 100644 --- a/subcmds/gc.py +++ b/subcmds/gc.py @@ -206,6 +206,7 @@ class Gc(Command): "--objects", f"--remotes={project.remote.name}", "--filter=blob:none", + "--tags", ], capture_stdout=True, verify_command=True, @@ -228,6 +229,7 @@ class Gc(Command): "--indexed-objects", "--not", f"--remotes={project.remote.name}", + "--tags", ], capture_stdout=True, verify_command=True,