]> git.ipfire.org Git - thirdparty/git.git/commit
t5326: demonstrate bitmap corruption after permutation
authorTaylor Blau <me@ttaylorr.com>
Tue, 25 Jan 2022 22:41:01 +0000 (17:41 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 27 Jan 2022 20:07:52 +0000 (12:07 -0800)
commit61fd31a17975ba27ef1d4a3f25bf55b92f5e7738
treeddd941dcabdbd57f2fce3fe90fc2253f0fa4d3c3
parentdcc0cd074f0c639a0df20461a301af6d45bd582e
t5326: demonstrate bitmap corruption after permutation

This patch demonstrates a cause of bitmap corruption that can occur when
the contents of the multi-pack index does not change, but the underlying
object order does.

In this example, we have a MIDX containing two packs, each with a
distinct set of objects (pack A corresponds to the tree, blob, and
commit from the first patch, and pack B corresponds to the second
patch).

First, a MIDX is written where the 'A' pack is preferred. As expected,
the bitmaps generated there are in-tact. But then, we generate an
identical MIDX with a different object order: this time preferring pack
'B'.

Due to a bug which will be explained and fixed in the following commit,
the MIDX is updated, but the .rev file is not, causing the .bitmap file
to be read incorrectly. Specifically, the .bitmap file will contain
correct data, but the auxiliary object order in the .rev file is stale,
causing readers to get confused by reading the new bitmaps using the old
object order.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Reviewed-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5326-multi-pack-bitmaps.sh