Skip to content

Commit 2bb0518

Browse files
megabreitgitster
authored andcommitted
t4151: make sure argument to 'test -z' is given
88d5072 (am --skip: revert changes introduced by failed 3way merge, 2015-06-06), unlike all the other patches in the series, forgot to quote the output from "$(git ls-files -u)" when using it as the argument to "test -z", leading to a syntax error on platforms whose test does not interpret "test -z" (no other arguments) as testing if a string "-z" is the null string (which GNU test and test that is built into bash and dash seem to do). Note that $(git ls-files -u | wc -l) is deliberately left unquoted, as some implementations of "wc -l" includes extra blank characters in its output and cannot be compared as string, i.e. "test 0 = $(...)". Signed-off-by: Armin Kunaschik <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7654286 commit 2bb0518

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t4151-am-abort.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ test_expect_success 'am -3 --abort removes otherfile-4' '
8282
test 4 = "$(cat otherfile-4)" &&
8383
git am --abort &&
8484
test_cmp_rev initial HEAD &&
85-
test -z $(git ls-files -u) &&
85+
test -z "$(git ls-files -u)" &&
8686
test_path_is_missing otherfile-4
8787
'
8888

0 commit comments

Comments
 (0)