Skip to content

Commit

Permalink
gc: Add tags to remote pack list
Browse files Browse the repository at this point in the history
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`.

[email protected]

Bug: b/392732561
Change-Id: Id94a40aebbe4f084c952329583d559d296db1a11
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/451422
Reviewed-by: Yiwei Zhang <[email protected]>
Tested-by: Josip Sokcevic <[email protected]>
Commit-Queue: Josip Sokcevic <[email protected]>
  • Loading branch information
sokcevicG authored and LUCI committed Feb 5, 2025
1 parent 99eca45 commit 8d5f032
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions subcmds/gc.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def repack_projects(self, projects: List[Project], opt):
"--objects",
f"--remotes={project.remote.name}",
"--filter=blob:none",
"--tags",
],
capture_stdout=True,
verify_command=True,
Expand All @@ -228,6 +229,7 @@ def repack_projects(self, projects: List[Project], opt):
"--indexed-objects",
"--not",
f"--remotes={project.remote.name}",
"--tags",
],
capture_stdout=True,
verify_command=True,
Expand Down

0 comments on commit 8d5f032

Please sign in to comment.