summaryrefslogtreecommitdiff
path: root/t/helper/test-read-midx.c
diff options
context:
space:
mode:
authorLibravatar Derrick Stolee <stolee@gmail.com>2018-07-12 15:39:32 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-07-20 11:27:28 -0700
commit662148c4356620f6567b0a689602079339ebadb7 (patch)
treef48a63aa641e6b9bc8720e85ce3161e56bf89dcc /t/helper/test-read-midx.c
parentmidx: write object id fanout chunk (diff)
downloadtgif-662148c4356620f6567b0a689602079339ebadb7.tar.xz
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>
Diffstat (limited to 't/helper/test-read-midx.c')
-rw-r--r--t/helper/test-read-midx.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/t/helper/test-read-midx.c b/t/helper/test-read-midx.c
index f7c17b0940..8e19972e89 100644
--- a/t/helper/test-read-midx.c
+++ b/t/helper/test-read-midx.c
@@ -26,6 +26,10 @@ static int read_midx_file(const char *object_dir)
printf(" oid-fanout");
if (m->chunk_oid_lookup)
printf(" oid-lookup");
+ if (m->chunk_object_offsets)
+ printf(" object-offsets");
+ if (m->chunk_large_offsets)
+ printf(" large-offsets");
printf("\nnum_objects: %d\n", m->num_objects);