diff options
| author | Taylor Blau <me@ttaylorr.com> | 2026-02-24 14:00:09 -0500 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-02-24 11:16:33 -0800 |
| commit | 82c905ea6bd79cd2045fea91b67f4c858379bff1 (patch) | |
| tree | f42d3e7f9604ad8008d5e77b3918bf0e39cb6139 /t | |
| parent | ac10f6aa40355bef7ead9e992e76c3a562d2c01a (diff) | |
| download | git-82c905ea6bd79cd2045fea91b67f4c858379bff1.tar.xz | |
midx-write.c: introduce `struct write_midx_opts`
In the MIDX writing code, there are four functions which perform some
sort of MIDX write operation. They are:
- write_midx_file()
- write_midx_file_only()
- expire_midx_packs()
- midx_repack()
All of these functions are thin wrappers over `write_midx_internal()`,
which implements the bulk of these routines. As a result, the
`write_midx_internal()` function takes six arguments.
Future commits in this series will want to add additional arguments, and
in general this function's signature will be the union of parameters
among *all* possible ways to write a MIDX.
Instead of adding yet more arguments to this function to support MIDX
compaction, introduce a `struct write_midx_opts`, which has the same
struct members as `write_midx_internal()`'s arguments.
Adding additional fields to the `write_midx_opts` struct is preferable
to adding additional arguments to `write_midx_internal()`. This is
because the callers below all zero-initialize the struct, so each time
we add a new piece of information, we do not have to pass the zero value
for it in all other call-sites that do not care about it.
For now, no functional changes are included in this patch.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
0 files changed, 0 insertions, 0 deletions
