Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/t5307-pack-missing-commit.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / t5307-pack-missing-commit.sh` 39 lines ยท 929 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='pack should notice missing commit objects' 4 5 . ./test-lib.sh 6 7 test_expect_success setup ' 8 for i in 1 2 3 4 5 9 do 10 echo "$i" >"file$i" && 11 git add "file$i" && 12 test_tick && 13 git commit -m "$i" && 14 git tag "tag$i" || return 1 15 done && 16 obj=$(git rev-parse --verify tag3) && 17 fanout=$(expr "$obj" : "\(..\)") && 18 remainder=$(expr "$obj" : "..\(.*\)") && 19 rm -f ".git/objects/$fanout/$remainder" 20 ' 21 22 test_expect_success 'check corruption' ' 23 test_must_fail git fsck 24 ' 25 26 test_expect_success 'rev-list notices corruption (1)' ' 27 test_must_fail env GIT_TEST_COMMIT_GRAPH=0 git -c core.commitGraph=false rev-list HEAD 28 ' 29 30 test_expect_success 'rev-list notices corruption (2)' ' 31 test_must_fail env GIT_TEST_COMMIT_GRAPH=0 git -c core.commitGraph=false rev-list --objects HEAD 32 ' 33 34 test_expect_success 'pack-objects notices corruption' ' 35 echo HEAD | 36 test_must_fail git pack-objects --revs pack 37 ' 38 39 test_done