You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PackWriter produces duplicate objects in pack during bitmap walk with index misses #314
When BitmapIndexImpl.CompressedBitmap.iterator() is used during a
bitmap walk with index misses (i.e. commits without precomputed
bitmaps that require RevWalk fallback), the same ObjectId can be
yielded twice: once from the mutableIndex range (position >=
indexObjectCount) and once from the ofObjectType range (position <
indexObjectCount).
PackWriter.addObject() inserts into objectsLists and objectsMap via
ObjectIdOwnerMap.add(), which does not check for duplicates. The
duplicate entry causes the object to be written to the pack twice.
This is reproducible on any repository where bitmap coverage is low
(e.g. an old repo with few selected commits in the bitmap) and midx
bitmap is enabled.
Actual behavior
The client fails with:
fatal: The same object appears twice in the pack
fatal: fetch-pack: invalid index-pack output
Clone/fetch is completely broken for the affected repository. 100%
reproducible, not a race condition.
Expected behavior
Clone/fetch should succeed. Each object should appear exactly once in
the pack regardless of bitmap coverage ratio.
Relevant log output
fatal: The same object 0021f932ac4d99e56d888832f024feee6318f1ad appears twice in the pack
fatal: fetch-pack: invalid index-pack output
Activity
Youtirsin commentedon Nov 3, 2026
Fix proposed at https://review.gerrithub.io/c/eclipse-jgit/jgit/+/1257708