summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorDerrick Stolee <stolee@gmail.com>2018-07-12 21:39:31 +0200
committerJunio C Hamano <gitster@pobox.com>2018-07-20 20:27:28 +0200
commitd7cacf29ccfcb2a33bcd8468f83daf822430f19a (patch)
tree2a554bd2a30108604d533686b430034f74f41286 /t
parentmidx: write object ids in a chunk (diff)
downloadgit-d7cacf29ccfcb2a33bcd8468f83daf822430f19a.tar.xz
git-d7cacf29ccfcb2a33bcd8468f83daf822430f19a.zip
midx: write object id fanout chunk
Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rw-r--r--t/helper/test-read-midx.c4
-rwxr-xr-xt/t5319-multi-pack-index.sh16
2 files changed, 12 insertions, 8 deletions
diff --git a/t/helper/test-read-midx.c b/t/helper/test-read-midx.c
index de6d452a7c..f7c17b0940 100644
--- a/t/helper/test-read-midx.c
+++ b/t/helper/test-read-midx.c
@@ -22,10 +22,12 @@ static int read_midx_file(const char *object_dir)
if (m->chunk_pack_names)
printf(" pack-names");
+ if (m->chunk_oid_fanout)
+ printf(" oid-fanout");
if (m->chunk_oid_lookup)
printf(" oid-lookup");
- printf("\n");
+ printf("\nnum_objects: %d\n", m->num_objects);
printf("packs:\n");
for (i = 0; i < m->num_packs; i++)
diff --git a/t/t5319-multi-pack-index.sh b/t/t5319-multi-pack-index.sh
index 4813610115..95e731ae52 100755
--- a/t/t5319-multi-pack-index.sh
+++ b/t/t5319-multi-pack-index.sh
@@ -5,10 +5,12 @@ test_description='multi-pack-indexes'
midx_read_expect () {
NUM_PACKS=$1
+ NUM_OBJECTS=$2
{
cat <<-EOF &&
- header: 4d494458 1 2 $NUM_PACKS
- chunks: pack-names oid-lookup
+ header: 4d494458 1 3 $NUM_PACKS
+ chunks: pack-names oid-fanout oid-lookup
+ num_objects: $NUM_OBJECTS
packs:
EOF
if test $NUM_PACKS -ge 1
@@ -24,7 +26,7 @@ midx_read_expect () {
test_expect_success 'write midx with no packs' '
test_when_finished rm -f pack/multi-pack-index &&
git multi-pack-index --object-dir=. write &&
- midx_read_expect 0
+ midx_read_expect 0 0
'
generate_objects () {
@@ -74,13 +76,13 @@ test_expect_success 'write midx with one v1 pack' '
pack=$(git pack-objects --index-version=1 pack/test <obj-list) &&
test_when_finished rm pack/test-$pack.pack pack/test-$pack.idx pack/multi-pack-index &&
git multi-pack-index --object-dir=. write &&
- midx_read_expect 1
+ midx_read_expect 1 18
'
test_expect_success 'write midx with one v2 pack' '
git pack-objects --index-version=2,0x40 pack/test <obj-list &&
git multi-pack-index --object-dir=. write &&
- midx_read_expect 1
+ midx_read_expect 1 18
'
test_expect_success 'add more objects' '
@@ -94,7 +96,7 @@ test_expect_success 'add more objects' '
test_expect_success 'write midx with two packs' '
git pack-objects --index-version=1 pack/test-2 <obj-list &&
git multi-pack-index --object-dir=. write &&
- midx_read_expect 2
+ midx_read_expect 2 34
'
test_expect_success 'add more packs' '
@@ -108,7 +110,7 @@ test_expect_success 'add more packs' '
test_expect_success 'write midx with twelve packs' '
git multi-pack-index --object-dir=. write &&
- midx_read_expect 12
+ midx_read_expect 12 74
'
test_done