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/lib-midx.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 / lib-midx.sh` 36 lines ยท 1018 bytes Raw Blame History 1 # test_midx_consistent 2 test_midx_consistent () { 3 ls $1/pack/pack-*.idx | xargs -n 1 basename | sort >expect && 4 test-tool read-midx $1 | grep ^pack-.*\.idx$ | sort >actual && 5 6 test_cmp expect actual && 7 git multi-pack-index --object-dir=$1 verify 8 } 9 10 midx_checksum () { 11 test-tool read-midx --checksum "$1" 12 } 13 14 midx_git_two_modes () { 15 git -c core.multiPackIndex=false $1 >expect && 16 git -c core.multiPackIndex=true $1 >actual && 17 if [ "$2" = "sorted" ] 18 then 19 sort expect.sorted && 20 mv expect.sorted expect && 21 sort actual.sorted && 22 mv actual.sorted actual 23 fi && 24 test_cmp expect actual 25 } 26 27 compare_results_with_midx () { 28 MSG=$1 29 test_expect_success "check normal git operations: $MSG" ' 30 midx_git_two_modes "rev-list --objects --all" && 31 midx_git_two_modes "log --raw" && 32 midx_git_two_modes "count-objects --verbose" && 33 midx_git_two_modes "cat-file --batch-all-objects --batch-check" && 34 midx_git_two_modes "cat-file --batch-all-objects --batch-check --unordered" sorted 35 ' 36 }