midx: pass custom '--base' through incremental writes
The 'multi-pack-index' builtin parses '--base' for incremental writes,
but the normal write path does not pass that value through to
`write_midx_file()`.
As a result, something like:
$ git multi-pack-index write --incremental --base=<base>
behaves as if no custom base had been given (unless the caller used the
'--stdin-packs' path).
Thread the parsed base through `write_midx_file()`, and update the
repack caller to pass NULL for the new argument where no custom base
selection is needed.
This exposes a pre-existing problem in incremental writes with custom
bases: the writer skips packs from the full existing MIDX chain, even
when the caller selected an older base or no base at all.
The affected t5334 cases fail while trying to write MIDX bitmaps. The
detached layer omits packs above the selected base, and thus the
resulting MIDX does not have a reachability closure, making it
impossible to generate reachability bitmaps.
Mark those tests as expected failures accordingly. The following commit
will fix the broken behavior and restore these tests.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau committedJun 12, 2026 at 16:07 UTC8e519b87565a8689d509693a049bc6dad632dbb3
5 files changed+25-8
builtin/multi-pack-index.c
+2-1
index 00ffb36394..949bfa796b 100644--- a/builtin/multi-pack-index.c+++ b/builtin/multi-pack-index.c@@ -224,7 +224,8 @@ static int cmd_multi_pack_index_write(int argc, const char **argv, } ret = write_midx_file(source, opts.preferred_pack,- opts.refs_snapshot, opts.flags);+ opts.refs_snapshot, opts.incremental_base,+ opts.flags); free(opts.refs_snapshot); return ret;