diff options
| author | Taylor Blau <me@ttaylorr.com> | 2025-10-15 18:27:30 -0400 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-10-16 10:08:53 -0700 |
| commit | cae9e2abbd8fb2fd483e101275cee15ef27d5953 (patch) | |
| tree | 040373c6d471c539d6b7cee321df9916e06e18dd | |
| parent | 03015747584e9f96c7ad6b57ecd99aa694312333 (diff) | |
| download | git-cae9e2abbd8fb2fd483e101275cee15ef27d5953.tar.gz | |
builtin/repack.c: avoid "the_repository" when repacking promisor objects
Pass a "struct repository" pointer to the 'repack_promisor_objects()'
function to avoid using "the_repository".
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
| -rw-r--r-- | builtin/repack.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/builtin/repack.c b/builtin/repack.c index 93802531e1..4f08b57ddb 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -407,7 +407,8 @@ static int has_pack_ext(const struct generated_pack_data *data, BUG("unknown pack extension: '%s'", ext); } -static void repack_promisor_objects(const struct pack_objects_args *args, +static void repack_promisor_objects(struct repository *repo, + const struct pack_objects_args *args, struct string_list *names) { struct child_process cmd = CHILD_PROCESS_INIT; @@ -424,7 +425,7 @@ static void repack_promisor_objects(const struct pack_objects_args *args, * {type -> existing pack order} ordering when computing deltas instead * of a {type -> size} ordering, which may produce better deltas. */ - for_each_packed_object(the_repository, write_oid, &cmd, + for_each_packed_object(repo, write_oid, &cmd, FOR_EACH_OBJECT_PROMISOR_ONLY); if (cmd.in == -1) { @@ -1458,7 +1459,7 @@ int cmd_repack(int argc, strvec_push(&cmd.args, "--delta-islands"); if (pack_everything & ALL_INTO_ONE) { - repack_promisor_objects(&po_args, &names); + repack_promisor_objects(repo, &po_args, &names); if (has_existing_non_kept_packs(&existing) && delete_redundant && |
