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>
Jeff King committed
Apr 5, 2019 at 14:04 UTC
b4a14394af96b6a87a722ffb57666bb1edc001b9
1 file changed
+7
-6
t/t5319-multi-pack-index.sh
+7
-6
@@ -86,13 +86,14 @@ test_expect_success 'write midx with one v1 pack' '
86
'
87
88
midx_git_two_modes () {
89
+ git -c core.multiPackIndex=false $1 >expect &&
90
+ git -c core.multiPackIndex=true $1 >actual &&
91
if [ "$2" = "sorted" ]
92
then
91
- git -c core.multiPackIndex=false $1 | sort >expect &&
92
- git -c core.multiPackIndex=true $1 | sort >actual
93
- else
94
- git -c core.multiPackIndex=false $1 >expect &&
95
- git -c core.multiPackIndex=true $1 >actual
93
+ sort <expect >expect.sorted &&
94
+ mv expect.sorted expect &&
95
+ sort <actual >actual.sorted &&
96
+ mv actual.sorted actual
97
fi &&
98
test_cmp expect actual
99
}
@@ -104,7 +105,7 @@ compare_results_with_midx () {
105
midx_git_two_modes "log --raw" &&
106
midx_git_two_modes "count-objects --verbose" &&
107
midx_git_two_modes "cat-file --batch-all-objects --buffer --batch-check" &&
107
- midx_git_two_modes "cat-file --batch-all-objects --buffer --batch-check --unsorted" sorted
108
+ midx_git_two_modes "cat-file --batch-all-objects --buffer --batch-check --unordered" sorted
109
'
110
}
111