From: Junio C Hamano Date: Thu, 30 Jul 2026 17:44:34 +0000 (-0700) Subject: Merge branch 'tb/midx-incremental-custom-base' into seen X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=88f6d1e04e8cba9a7e2d746ba9352f2e7667d785;p=thirdparty%2Fgit.git Merge branch 'tb/midx-incremental-custom-base' into seen The 'git multi-pack-index write --incremental' command has been corrected to properly honor the '--base' option. Previously, the custom base was ignored by the normal write path; packs from layers above the selected base were incorrectly skipped by the pack exclusion logic, and reachability closure for bitmaps was broken. * tb/midx-incremental-custom-base: midx-write: include packs above custom incremental base midx: pass custom '--base' through incremental writes t5334: expose shared `nth_line()` helper --- 88f6d1e04e8cba9a7e2d746ba9352f2e7667d785 diff --cc builtin/multi-pack-index.c index 6e73c85cde,949bfa796b..84d2467cc7 --- a/builtin/multi-pack-index.c +++ b/builtin/multi-pack-index.c @@@ -224,8 -223,9 +224,9 @@@ static int cmd_multi_pack_index_write(i } - ret = write_midx_file(source, opts.preferred_pack, + ret = write_midx_file(source->packed, opts.preferred_pack, - opts.refs_snapshot, opts.flags); + opts.refs_snapshot, opts.incremental_base, + opts.flags); free(opts.refs_snapshot); return ret; diff --cc builtin/repack.c index db504d673f,0092a72a99..49385c885b --- a/builtin/repack.c +++ b/builtin/repack.c @@@ -627,12 -626,10 +627,12 @@@ int cmd_repack(int argc update_server_info(repo, 0); if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX, 0)) { + struct odb_source_files *files = odb_source_files_downcast(existing.source); unsigned flags = 0; + if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX_WRITE_INCREMENTAL, 0)) flags |= MIDX_WRITE_INCREMENTAL; - write_midx_file(files->packed, NULL, NULL, flags); - write_midx_file(existing.source, NULL, NULL, NULL, flags); ++ write_midx_file(files->packed, NULL, NULL, NULL, flags); } cleanup: diff --cc midx-write.c index 580724d21a,c50fdb5c6d..d0adefe6ce --- a/midx-write.c +++ b/midx-write.c @@@ -1848,9 -1853,10 +1854,10 @@@ cleanup return result; } -int write_midx_file(struct odb_source *source, +int write_midx_file(struct odb_source_packed *source, const char *preferred_pack_name, const char *refs_snapshot, + const char *incremental_base, unsigned flags) { struct write_midx_opts opts = { diff --cc midx.h index 939c18e588,92ed29d913..e35db74905 --- a/midx.h +++ b/midx.h @@@ -129,10 -129,10 +129,10 @@@ int prepare_multi_pack_index_one(struc * Variant of write_midx_file which writes a MIDX containing only the packs * specified in packs_to_include. */ -int write_midx_file(struct odb_source *source, +int write_midx_file(struct odb_source_packed *source, const char *preferred_pack_name, const char *refs_snapshot, - unsigned flags); + const char *incremental_base, unsigned flags); -int write_midx_file_only(struct odb_source *source, +int write_midx_file_only(struct odb_source_packed *source, struct string_list *packs_to_include, const char *preferred_pack_name, const char *refs_snapshot,