t5319: fix bogus cat-file argument

There's no such argument as "--unsorted"; it's spelled "--unordered".
But our test failed to notice that cat-file didn't run at all because:

  1. It lost the exit code of git on the left-hand side of a pipe.

  2. It was comparing two runs of the broken invocation with and without
     a particular config variable (and indeed, both cases produced no
     output!).

Let's fix the option, but also tweak the helper function to check the
exit code.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King 2019-04-05 14:04:56 -04:00 коммит произвёл Junio C Hamano
Родитель 4828ce9871
Коммит b4a14394af
1 изменённых файлов: 7 добавлений и 6 удалений

Просмотреть файл

@ -86,13 +86,14 @@ test_expect_success 'write midx with one v1 pack' '
'
midx_git_two_modes () {
git -c core.multiPackIndex=false $1 >expect &&
git -c core.multiPackIndex=true $1 >actual &&
if [ "$2" = "sorted" ]
then
git -c core.multiPackIndex=false $1 | sort >expect &&
git -c core.multiPackIndex=true $1 | sort >actual
else
git -c core.multiPackIndex=false $1 >expect &&
git -c core.multiPackIndex=true $1 >actual
sort <expect >expect.sorted &&
mv expect.sorted expect &&
sort <actual >actual.sorted &&
mv actual.sorted actual
fi &&
test_cmp expect actual
}
@ -104,7 +105,7 @@ compare_results_with_midx () {
midx_git_two_modes "log --raw" &&
midx_git_two_modes "count-objects --verbose" &&
midx_git_two_modes "cat-file --batch-all-objects --buffer --batch-check" &&
midx_git_two_modes "cat-file --batch-all-objects --buffer --batch-check --unsorted" sorted
midx_git_two_modes "cat-file --batch-all-objects --buffer --batch-check --unordered" sorted
'
}