summaryrefslogtreecommitdiff
path: root/t/chainlint
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2018-08-13 08:47:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-13 19:22:11 (GMT)
commit06fc5c9f90da9be18371bafad5f35b6b17cbf49e (patch)
tree63a687d5cf04e2e1a0d9a70ffacc8c0dbbbd38df /t/chainlint
parent7e32a31b2101c3ced65ea9367c747930a4eb39d9 (diff)
downloadgit-06fc5c9f90da9be18371bafad5f35b6b17cbf49e.zip
git-06fc5c9f90da9be18371bafad5f35b6b17cbf49e.tar.gz
git-06fc5c9f90da9be18371bafad5f35b6b17cbf49e.tar.bz2
chainlint: recognize multi-line $(...) when command cuddled with "$("
For multi-line $(...) expressions nested within subshells, chainlint.sed only recognizes: x=$( echo foo && ... but it is not unlikely that test authors may also cuddle the command with the opening "$(", so support that style, as well: x=$(echo foo && ... The closing ")" is already correctly recognized when cuddled or not. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/chainlint')
-rw-r--r--t/chainlint/multi-line-nested-command-substitution.expect11
-rw-r--r--t/chainlint/multi-line-nested-command-substitution.test11
2 files changed, 20 insertions, 2 deletions
diff --git a/t/chainlint/multi-line-nested-command-substitution.expect b/t/chainlint/multi-line-nested-command-substitution.expect
index 19c023b..59b6c8b 100644
--- a/t/chainlint/multi-line-nested-command-substitution.expect
+++ b/t/chainlint/multi-line-nested-command-substitution.expect
@@ -6,4 +6,13 @@
>> ) &&
echo ok
>) |
-sort
+sort &&
+(
+ bar &&
+ x=$(echo bar |
+ cat
+>> ) &&
+ y=$(echo baz |
+>> fip) &&
+ echo fail
+>)
diff --git a/t/chainlint/multi-line-nested-command-substitution.test b/t/chainlint/multi-line-nested-command-substitution.test
index ca0620a..3000583 100644
--- a/t/chainlint/multi-line-nested-command-substitution.test
+++ b/t/chainlint/multi-line-nested-command-substitution.test
@@ -6,4 +6,13 @@
) &&
echo ok
) |
-sort
+sort &&
+(
+ bar &&
+ x=$(echo bar |
+ cat
+ ) &&
+ y=$(echo baz |
+ fip) &&
+ echo fail
+)