t/helper/test-read-midx.c: add --checksum mode

Subsequent tests will want to check for the existence of a multi-pack
bitmap which matches the multi-pack-index stored in the pack directory.

The multi-pack bitmap includes the hex checksum of the MIDX it
corresponds to in its filename (for example,
'$packdir/multi-pack-index-<checksum>.bitmap'). As a result, some tests
want a way to learn what '<checksum>' is.

This helper addresses that need by printing the checksum of the
repository's multi-pack-index.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Taylor Blau
2021-08-31 16:52:28 -04:00
committed by Junio C Hamano
parent aeb4657242
commit b1b82d1c30
2 changed files with 19 additions and 1 deletions

View File

@ -260,3 +260,7 @@ have_delta () {
echo $1 | git cat-file --batch-check="%(deltabase)" >actual &&
test_cmp expect actual
}
midx_checksum () {
test-tool read-midx --checksum "$1"
}