]> git.ipfire.org Git - thirdparty/git.git/commit
pack-bitmap: introduce function to open bitmap for a single source
authorPatrick Steinhardt <ps@pks.im>
Wed, 15 Jul 2026 06:22:37 +0000 (08:22 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Jul 2026 14:19:16 +0000 (07:19 -0700)
commit8cd7ee7b0d12fce9449ea08fe394e18dc97fe059
tree95fb5772ce95fc5dc5612a4f898e01d80f793096
parentdb95bfc121aa9725e8128d7b1dd73330c0beb7f9
pack-bitmap: introduce function to open bitmap for a single source

The function `prepare_bitmap_git()` opens the first bitmap it can find
in any of the object sources connected to the repository. In a
subsequent commit, the "packed" object database backend will learn to
use bitmaps to answer object filters when enumerating objects. That
backend operates on a single object source though, so using a bitmap
that potentially belongs to a different source would be wrong:

  - The source would yield objects that are not part of the source
    itself.

  - The object source info would be attributed to the wrong source.

  - With multiple sources, each source would enumerate the same bitmap
    another time.

Introduce a new function `prepare_bitmap_git_for_source()` that only
opens bitmaps belonging to the given object source.

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