]> git.ipfire.org Git - thirdparty/git.git/commit
midx-write: extract function to test whether MIDX needs updating
authorPatrick Steinhardt <ps@pks.im>
Wed, 10 Dec 2025 12:52:19 +0000 (13:52 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Dec 2025 03:09:58 +0000 (12:09 +0900)
commitb3bab9d2729fde1f52c407447711c34a75c5c377
tree7fd740e1fe8cb515ca79bf8fc1fe803e7d1b1ab6
parent665d19ec7bcc2d578e2fa2701f7399a6a965b086
midx-write: extract function to test whether MIDX needs updating

In `write_midx_internal()` we know to skip writing the new multi-pack
index in case it would be the same as the existing one. This logic does
not handle the `--stdin-packs` option yet though, so we end up always
rewriting the MIDX if that option is passed to us.

Extract the logic to decide whether or not to rewrite the MIDX into a
separate function. This will allow us to extend that feature in the next
commit to address the above issue.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
midx-write.c