]> git.ipfire.org Git - thirdparty/git.git/commit
midx: teach `nth_midxed_object_oid()` about incremental MIDXs
authorTaylor Blau <me@ttaylorr.com>
Tue, 6 Aug 2024 15:37:24 +0000 (11:37 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 6 Aug 2024 19:01:36 +0000 (12:01 -0700)
commit26afb5afa16c9ea7825fdeae05e31d619849ad4b
tree82fc19480ac0a962d223987f450af1d0434a0c3c
parent1820bd878c623a71ffc719ff09071fc6bbc6e34e
midx: teach `nth_midxed_object_oid()` about incremental MIDXs

The function `nth_midxed_object_oid()` returns the object ID for a given
object position in the MIDX lexicographic order.

Teach this function to instead operate over the concatenated
lexicographic order defined in an earlier step so that it is able to be
used with incremental MIDXs.

To do this, we need to both (a) adjust the bounds check for the given
'n', as well as record the MIDX-local position after chasing the
`->base_midx` pointer to find the MIDX which contains that object.

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