]> git.99rst.org Git - git.git/commit
pack-bitmap.c: teach `bitmap_for_commit()` about incremental MIDXs
authorTaylor Blau <redacted>
Thu, 20 Mar 2025 17:56:37 +0000 (13:56 -0400)
committerJunio C Hamano <redacted>
Fri, 21 Mar 2025 11:33:41 +0000 (04:33 -0700)
commitae61324f0a6124534a245b70d55d63b5abf3e5d4
tree32ed725d6a382ceb6d8f40bbe678519664ff4aec
parentf31a17cea5f6f66436e20f5dcefb6a0464238864
pack-bitmap.c: teach `bitmap_for_commit()` about incremental MIDXs

The pack-bitmap machinery uses `bitmap_for_commit()` to locate the
EWAH-compressed bitmap corresponding to some given commit object.

Teach this function about incremental MIDX bitmaps by teaching it to
recur on earlier bitmap layers when it fails to find a given commit in
the current layer.

The changes to do so are as follows:

  - Avoid initializing hash_pos at its declaration, since
    bitmap_for_commit() is now a recursive function and may receive a
    NULL bitmap_index pointer as its first argument.

  - In cases where we would previously return NULL (to indicate that a
    lookup failed and the given bitmap_index does not contain an entry
    corresponding to the given commit), recursively call the function on
    the previous bitmap layer.

Signed-off-by: Taylor Blau <redacted>
Acked-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
pack-bitmap.c
git clone https://git.99rst.org/PROJECT