Skip to content

housekeeping: Don't write bitmaps with MIDX in pooled repos

With ef10b419 (housekeeping: Enable writing of multi-pack-indices, 2023-01-26), we have introduced the logic to write multi-pack-indices in repositories. And as it is now possible to create bitmaps that span over multiple packfiles and thus compute them during incremental repacks, one of the assumptions I made was that it is also possible to create bitmaps in pooled repositories now.

As it turns out, this assumption is wrong:

$ git init pool
Reinitialized existing Git repository in /tmp/pool/.git/
$ git -C pool commit -mshared --allow-empty
[main f8e3031] shared

$ git clone --shared pool member
Cloning into 'member'...
done.
$ git -C member commit -mnot-shared --allow-empty
[main 763d6e8] not-shared

$ git -C member repack -Adlb --write-midx
Enumerating objects: 4, done.
Counting objects: 100% (1/1), done.
Writing objects: 100% (1/1), done.
Total 1 (delta 0), reused 0 (delta 0), pack-reused 0
warning: Failed to write bitmap index. Packfile doesn't have full closure (object f50da2fbdf73aeabaded8d6bbda60ff12641f998 is missing)
error: could not write multi-pack bitmap

So even though we indeed have the ability to write bitmaps for incremental repacks, we still cannot do so for object pool members.

Fix the optimization strategy to not write bitmaps in case the repository is linked to an object pool. Add tests for object pool members that would have failed with the above error to catch any regressions going forward.

Part of #4741 (closed).

Edited by Patrick Steinhardt

Merge request reports