diff options
| author | Taylor Blau <me@ttaylorr.com> | 2025-10-15 18:28:10 -0400 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-10-16 10:08:54 -0700 |
| commit | 9574e8f31d6d920973213ae5dbab6b77d2deeadf (patch) | |
| tree | 278fa04f013a97661948e9939a3cf92931ada7d7 /builtin/repack.c | |
| parent | repack: remove 'remove_redundant_pack' from the builtin (diff) | |
| download | git-9574e8f31d6d920973213ae5dbab6b77d2deeadf.tar.gz git-9574e8f31d6d920973213ae5dbab6b77d2deeadf.zip | |
builtin/repack.c: pass "packdir" when removing packs
builtin/repack.c defines a static "packdir" to instruct pack-objects on
where to write any new packfiles. This is also the directory scanned
when removing any packfiles which were made redundant by the latest
repack.
Prepare to move the "existing_packs_remove_redundant" function to its
own compilation unit by passing in this information as a parameter to
that function.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
| -rw-r--r-- | builtin/repack.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/builtin/repack.c b/builtin/repack.c index 31137cf711..c5a88eda12 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -209,7 +209,8 @@ static void existing_packs_mark_for_deletion(struct existing_packs *existing, } static void remove_redundant_packs_1(struct repository *repo, - struct string_list *packs) + struct string_list *packs, + const char *packdir) { struct string_list_item *item; for_each_string_list_item(item, packs) { @@ -219,10 +220,13 @@ static void remove_redundant_packs_1(struct repository *repo, } } -static void existing_packs_remove_redundant(struct existing_packs *existing) +static void existing_packs_remove_redundant(struct existing_packs *existing, + const char *packdir) { - remove_redundant_packs_1(existing->repo, &existing->non_kept_packs); - remove_redundant_packs_1(existing->repo, &existing->cruft_packs); + remove_redundant_packs_1(existing->repo, &existing->non_kept_packs, + packdir); + remove_redundant_packs_1(existing->repo, &existing->cruft_packs, + packdir); } static void existing_packs_release(struct existing_packs *existing) @@ -1659,7 +1663,7 @@ int cmd_repack(int argc, if (delete_redundant) { int opts = 0; - existing_packs_remove_redundant(&existing); + existing_packs_remove_redundant(&existing, packdir); if (geometry.split_factor) geometry_remove_redundant_packs(&geometry, &names, |
