]> git.ipfire.org Git - thirdparty/git.git/commit - midx.h
midx: write object offsets
authorDerrick Stolee <stolee@gmail.com>
Thu, 12 Jul 2018 19:39:32 +0000 (15:39 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 Jul 2018 18:27:28 +0000 (11:27 -0700)
commit662148c4356620f6567b0a689602079339ebadb7
treef48a63aa641e6b9bc8720e85ce3161e56bf89dcc
parentd7cacf29ccfcb2a33bcd8468f83daf822430f19a
midx: write object offsets

The final pair of chunks for the multi-pack-index file stores the object
offsets. We default to using 32-bit offsets as in the pack-index version
1 format, but if there exists an offset larger than 32-bits, we use a
trick similar to the pack-index version 2 format by storing all offsets
at least 2^31 in a 64-bit table; we use the 32-bit table to point into
that 64-bit table as necessary.

We only store these 64-bit offsets if necessary, so create a test that
manipulates a version 2 pack-index to fake a large offset. This allows
us to test that the large offset table is created, but the data does not
match the actual packfile offsets. The multi-pack-index offset does match
the (corrupted) pack-index offset, so a future feature will compare these
offsets during a 'verify' step.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/technical/pack-format.txt
midx.c
midx.h
t/helper/test-read-midx.c
t/t5319-multi-pack-index.sh