t/README: add missing value for GIT_TEST_DEFAULT_REF_FORMAT
[git/gitster.git] / t / lib-midx.sh
blobe38c609604c3011d7363a9e01b4d6fe62b904025
1 # test_midx_consistent <objdir>
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 &&
6 test_cmp expect actual &&
7 git multi-pack-index --object-dir=$1 verify
10 midx_checksum () {
11 test-tool read-midx --checksum "$1"
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 >expect.sorted &&
20 mv expect.sorted expect &&
21 sort <actual >actual.sorted &&
22 mv actual.sorted actual
23 fi &&
24 test_cmp expect actual
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