diff options
author | Patrick Steinhardt <ps@pks.im> | 2023-04-14 08:01:36 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-04-14 10:27:51 -0700 |
commit | 3d74a2337c679839265efa16b2bca2a9b7795a00 (patch) | |
tree | 8dd6c351133f15213cdad19fa4ab1a098d4f45b0 /commit-graph.c | |
parent | ceb96a160b05c3ec45c416851bac00b711418839 (diff) |
repack: fix trying to use preferred pack in alternates
When doing a geometric repack with multi-pack-indices, then we ask
git-multi-pack-index(1) to use the largest packfile as the preferred
pack. It can happen though that the largest packfile is not part of the
main object database, but instead part of an alternate object database.
The result is that git-multi-pack-index(1) will not be able to find the
preferred pack and print a warning. It then falls back to use the first
packfile that the multi-pack-index shall reference.
Fix this bug by only considering packfiles as preferred pack that are
local. This is the right thing to do given that a multi-pack-index
should never reference packfiles borrowed from an alternate.
While at it, rename the function `get_largest_active_packfile()` to
`get_preferred_pack()` to better document its intent.
Helped-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.c')
0 files changed, 0 insertions, 0 deletions