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
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" ]
19 sort <expect
>expect.sorted
&&
20 mv expect.sorted expect
&&
21 sort <actual
>actual.sorted
&&
22 mv actual.sorted actual
24 test_cmp expect actual
27 compare_results_with_midx
() {
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