diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2019-12-21 19:49:27 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-01-15 14:06:19 -0800 |
commit | 82d5aeb1e606d6fb397d92c1b8ec95fd94b71d95 (patch) | |
tree | 3a205dc15d68a2c0b55f2beb18726a2fa0c43ee8 /t/t5324-split-commit-graph.sh | |
parent | 3c5e65cac15a7f3a52fc53babd079aeaddb47c20 (diff) | |
download | git-82d5aeb1e606d6fb397d92c1b8ec95fd94b71d95.tar.gz |
t5324: make hash size independent
There are some offsets in the commit graph files used to corrupt data.
Compute these offsets for both SHA-1 and SHA-256 so that the test works
with either.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5324-split-commit-graph.sh')
-rwxr-xr-x | t/t5324-split-commit-graph.sh | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/t/t5324-split-commit-graph.sh b/t/t5324-split-commit-graph.sh index c24823431f..53b2e6b455 100755 --- a/t/t5324-split-commit-graph.sh +++ b/t/t5324-split-commit-graph.sh @@ -11,7 +11,14 @@ test_expect_success 'setup repo' ' git config gc.writeCommitGraph false && infodir=".git/objects/info" && graphdir="$infodir/commit-graphs" && - test_oid_init + test_oid_init && + test_oid_cache <<-EOM + shallow sha1:1760 + shallow sha256:2064 + + base sha1:1376 + base sha256:1496 + EOM ' graph_read_expect() { @@ -248,7 +255,7 @@ test_expect_success 'verify hashes along chain, even in shallow' ' cd verify && git commit-graph verify && base_file=$graphdir/graph-$(head -n 1 $graphdir/commit-graph-chain).graph && - corrupt_file "$base_file" 1760 "\01" && + corrupt_file "$base_file" $(test_oid shallow) "\01" && test_must_fail git commit-graph verify --shallow 2>test_err && grep -v "^+" test_err >err && test_i18ngrep "incorrect checksum" err @@ -275,7 +282,7 @@ test_expect_success 'warn on base graph chunk incorrect' ' cd base-chunk && git commit-graph verify && base_file=$graphdir/graph-$(tail -n 1 $graphdir/commit-graph-chain).graph && - corrupt_file "$base_file" 1376 "\01" && + corrupt_file "$base_file" $(test_oid base) "\01" && git commit-graph verify --shallow 2>test_err && grep -v "^+" test_err >err && test_i18ngrep "commit-graph chain does not match" err |