Skip to content
Snippets Groups Projects
Commit de231e57 authored by Ævar Arnfjörð Bjarmason's avatar Ævar Arnfjörð Bjarmason Committed by Junio C Hamano
Browse files

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 c2f1d398 ("t4013: test new output from diff
--abbrev --raw", 2017-12-03) first released with Git v2.16.0.

Signed-off-by: default avatarÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
parent 4a3ed638
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -140,7 +140,7 @@ do
expect="$TEST_DIRECTORY/t4013/diff.$test"
actual="$pfx-diff.$test"
 
test_expect_success "git $cmd # magic is ${magic:-"(not used)"}" '
test_expect_success "git $cmd # magic is ${magic:-(not used)}" '
{
echo "$ git $cmd"
case "$magic" in
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment