Skip to content

Commit de231e5

Browse files
avargitster
authored andcommitted
tests: fix non-portable "${var:-"str"}" construct
On both AIX 7200-00-01-1543 and FreeBSD 11.2-RELEASE-p2 the "${var:-"str"}" syntax means something different than what it does under the bash or dash shells. Both will consider the start of the new unescaped quotes to be a new argument to test_expect_success, resulting in the following error: error: bug in the test script: 'git diff-tree initial # magic is (not' does not look like a prereq Fix this by removing the redundant quotes. There's no need for them, and the resulting code works under all the aforementioned shells. This fixes a regression in c2f1d39 ("t4013: test new output from diff --abbrev --raw", 2017-12-03) first released with Git v2.16.0. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4a3ed63 commit de231e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t4013-diff-various.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ do
140140
expect="$TEST_DIRECTORY/t4013/diff.$test"
141141
actual="$pfx-diff.$test"
142142

143-
test_expect_success "git $cmd # magic is ${magic:-"(not used)"}" '
143+
test_expect_success "git $cmd # magic is ${magic:-(not used)}" '
144144
{
145145
echo "$ git $cmd"
146146
case "$magic" in

0 commit comments

Comments
 (0)