]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/repack.c: convert `--write-midx` to an `OPT_CALLBACK`
authorTaylor Blau <me@ttaylorr.com>
Tue, 19 May 2026 15:58:13 +0000 (11:58 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 20 May 2026 02:31:14 +0000 (11:31 +0900)
commitd376967fbfb0b366c08be50a1c41d6b30c5e6d89
tree961b03af722871d6d710e6ed32b69c7973f92956
parentd0ac3969f4b8a859d23c9f45cab873cbbf8cdfb8
builtin/repack.c: convert `--write-midx` to an `OPT_CALLBACK`

Change the --write-midx (-m) flag from an OPT_BOOL to an OPT_CALLBACK
that accepts an optional mode argument. Introduce an enum with
REPACK_WRITE_MIDX_NONE and REPACK_WRITE_MIDX_DEFAULT to distinguish
between the two states, and update all existing boolean checks
accordingly.

For now, passing no argument (or just `-m`) selects the default mode,
preserving existing behavior. A subsequent commit will add a new mode
for writing incremental MIDXs.

Extract repack_write_midx() as a dispatcher that selects the
appropriate MIDX-writing implementation based on the mode.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/repack.c
repack-midx.c
repack.h