Skip to content

Commit 66c9562

Browse files
sgngitster
authored andcommitted
t6400: preserve git ls-files exit status code
In t6400, we're checking number of files in the index and the working tree by piping the output of "git ls-files" to "wc -l", thus losing the exit status code of git. Let's use the newly introduced test_stdout_line_count in order to check the exit status code of Git's command. Signed-off-by: Đoàn Trần Công Danh <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cdff1bb commit 66c9562

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

t/t6400-merge-df.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ test_expect_success 'modify/delete + directory/file conflict' '
8282
git checkout delete^0 &&
8383
test_must_fail git merge modify &&
8484
85-
test 5 -eq $(git ls-files -s | wc -l) &&
86-
test 4 -eq $(git ls-files -u | wc -l) &&
85+
test_stdout_line_count = 5 git ls-files -s &&
86+
test_stdout_line_count = 4 git ls-files -u &&
8787
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
8888
then
89-
test 0 -eq $(git ls-files -o | wc -l)
89+
test_stdout_line_count = 0 git ls-files -o
9090
else
91-
test 1 -eq $(git ls-files -o | wc -l)
91+
test_stdout_line_count = 1 git ls-files -o
9292
fi &&
9393
9494
test_path_is_file letters/file &&
@@ -103,13 +103,13 @@ test_expect_success 'modify/delete + directory/file conflict; other way' '
103103
104104
test_must_fail git merge delete &&
105105
106-
test 5 -eq $(git ls-files -s | wc -l) &&
107-
test 4 -eq $(git ls-files -u | wc -l) &&
106+
test_stdout_line_count = 5 git ls-files -s &&
107+
test_stdout_line_count = 4 git ls-files -u &&
108108
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
109109
then
110-
test 0 -eq $(git ls-files -o | wc -l)
110+
test_stdout_line_count = 0 git ls-files -o
111111
else
112-
test 1 -eq $(git ls-files -o | wc -l)
112+
test_stdout_line_count = 1 git ls-files -o
113113
fi &&
114114
115115
test_path_is_file letters/file &&

0 commit comments

Comments
 (0)