midx: write multi-pack indices via their source

Similar to the preceding commit, refactor the writing side of multi-pack
indices so that we pass in the object database source where the index
should be written to.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2025-08-11 15:46:48 +02:00
committed by Junio C Hamano
parent 017db7bb14
commit c3f5d25146
4 changed files with 47 additions and 49 deletions

View File

@@ -1711,7 +1711,7 @@ int cmd_repack(int argc,
unsigned flags = 0;
if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX_WRITE_INCREMENTAL, 0))
flags |= MIDX_WRITE_INCREMENTAL;
write_midx_file(the_repository, repo_get_object_directory(the_repository),
write_midx_file(the_repository->objects->sources,
NULL, NULL, flags);
}