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>

Taylor Blau committed Oct 15, 2025 at 18:27 UTC cae9e2abbd8fb2fd483e101275cee15ef27d5953
1 file changed +4 -3
builtin/repack.c
+4 -3
@@ -407,7 +407,8 @@ static int has_pack_ext(const struct generated_pack_data *data,
407 BUG("unknown pack extension: '%s'", ext);
408 }
409
410 -static void repack_promisor_objects(const struct pack_objects_args *args,
410 +static void repack_promisor_objects(struct repository *repo,
411 + const struct pack_objects_args *args,
412 struct string_list *names)
413 {
414 struct child_process cmd = CHILD_PROCESS_INIT;
@@ -424,7 +425,7 @@ static void repack_promisor_objects(const struct pack_objects_args *args,
425 * {type -> existing pack order} ordering when computing deltas instead
426 * of a {type -> size} ordering, which may produce better deltas.
427 */
427 - for_each_packed_object(the_repository, write_oid, &cmd,
428 + for_each_packed_object(repo, write_oid, &cmd,
429 FOR_EACH_OBJECT_PROMISOR_ONLY);
430
431 if (cmd.in == -1) {
@@ -1458,7 +1459,7 @@ int cmd_repack(int argc,
1459 strvec_push(&cmd.args, "--delta-islands");
1460
1461 if (pack_everything & ALL_INTO_ONE) {
1461 - repack_promisor_objects(&po_args, &names);
1462 + repack_promisor_objects(repo, &po_args, &names);
1463
1464 if (has_existing_non_kept_packs(&existing) &&
1465 delete_redundant &&