]> Kevux Git Server - rit/commit
midx: stop using linked list when closing MIDX
authorPatrick Steinhardt <ps@pks.im>
Tue, 15 Jul 2025 11:29:20 +0000 (13:29 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 15 Jul 2025 19:07:29 +0000 (12:07 -0700)
commit6567432ab4f93f63cd2111197c91651a9b04c517
treeedfc04c2afecd1a56fb0ffa1cbe83be1073688ee
parentec4380f446b76e931002481f3e4be520c77058b6
midx: stop using linked list when closing MIDX

When calling `close_midx()` we not only close the multi-pack index for
one object source, but instead we iterate through the whole linked list
of MIDXs to close all of them. This linked list is about to go away in
favor of using the new per-source pointer to its respective MIDX.

Refactor the function to iterate through sources instead.

Note that after this patch, there's a couple of callsites left that
continue to use `close_midx()` without iterating through all sources.
These are all cases where we don't care about the MIDX from other
sources though, so it's fine to keep them as-is.

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