]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/repack.c: extract opts struct for 'write_midx_included_packs()'
authorTaylor Blau <me@ttaylorr.com>
Wed, 15 Oct 2025 22:28:53 +0000 (18:28 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Oct 2025 17:08:55 +0000 (10:08 -0700)
commite6b09077216ecc1c767506f39be736ba3dcccecb
tree476621137c842e696ab13ec8e365c6edf795857c
parentccb7f822d520472026a12250e1390683706a8154
builtin/repack.c: extract opts struct for 'write_midx_included_packs()'

The function 'write_midx_included_packs()', which is responsible for
writing a new MIDX with a given set of included packs, currently takes a
list of six arguments.

In order to extract this function out of the builtin, we have to pass
in a few additional parameters, like 'midx_must_contain_cruft' and
'packdir', which are currently declared as static variables within the
builtin/repack.c compilation unit.

Instead of adding additional parameters to `write_midx_included_packs()`
extract out an "opts" struct that names these parameters, and pass a
pointer to that, making it less cumbersome to add additional parameters.

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