3 test_description
='pack should notice missing commit objects'
5 TEST_PASSES_SANITIZE_LEAK
=true
8 test_expect_success setup
'
11 echo "$i" >"file$i" &&
15 git tag "tag$i" || return 1
17 obj=$(git rev-parse --verify tag3) &&
18 fanout=$(expr "$obj" : "\(..\)") &&
19 remainder=$(expr "$obj" : "..\(.*\)") &&
20 rm -f ".git/objects/$fanout/$remainder"
23 test_expect_success
'check corruption' '
24 test_must_fail git fsck
27 test_expect_success
'rev-list notices corruption (1)' '
28 test_must_fail env GIT_TEST_COMMIT_GRAPH=0 git -c core.commitGraph=false rev-list HEAD
31 test_expect_success
'rev-list notices corruption (2)' '
32 test_must_fail env GIT_TEST_COMMIT_GRAPH=0 git -c core.commitGraph=false rev-list --objects HEAD
35 test_expect_success
'pack-objects notices corruption' '
37 test_must_fail git pack-objects --revs pack