Skip to content

Commit

Permalink
t7800: avoid arithmetic expansion notation
Browse files Browse the repository at this point in the history
The construct "var=$(( something ..." is interpreted by some shells as
arithmetic expansion, even when it clearly is not, e.g.

	var=$((foo; bar) | baz)

Avoid the issue by giving an extra SP to help the parser, i.e.

	var=$( (foo; bar) | baz )

Noticed by Michael J Gruber.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Oct 14, 2011
1 parent ba959de commit 15a31e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions t/t7800-difftool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ test_expect_success PERL 'setup with 2 files different' '
'

test_expect_success PERL 'say no to the first file' '
diff=$((echo n; echo) | git difftool -x cat branch) &&
diff=$( (echo n; echo) | git difftool -x cat branch ) &&
echo "$diff" | stdin_contains m2 &&
echo "$diff" | stdin_contains br2 &&
Expand All @@ -298,7 +298,7 @@ test_expect_success PERL 'say no to the first file' '
'

test_expect_success PERL 'say no to the second file' '
diff=$((echo; echo n) | git difftool -x cat branch) &&
diff=$( (echo; echo n) | git difftool -x cat branch ) &&
echo "$diff" | stdin_contains master &&
echo "$diff" | stdin_contains branch &&
Expand Down

0 comments on commit 15a31e7

Please sign in to comment.