mirror of
https://github.com/git-for-windows/git.git
synced 2025-12-14 10:37:53 -06:00
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>
This commit is contained in:
parent
7e32a31b21
commit
06fc5c9f90
@ -216,7 +216,7 @@ s/.*\n//
|
|||||||
# "$(...)" -- command substitution; not closing ")"
|
# "$(...)" -- command substitution; not closing ")"
|
||||||
/\$([^)][^)]*)[^)]*$/bcheckchain
|
/\$([^)][^)]*)[^)]*$/bcheckchain
|
||||||
# multi-line "$(...\n...)" -- command substitution; treat as nested subshell
|
# multi-line "$(...\n...)" -- command substitution; treat as nested subshell
|
||||||
/\$([ ]*$/bnest
|
/\$([^)]*$/bnest
|
||||||
# "=(...)" -- Bash array assignment; not closing ")"
|
# "=(...)" -- Bash array assignment; not closing ")"
|
||||||
/=(/bcheckchain
|
/=(/bcheckchain
|
||||||
# closing "...) &&"
|
# closing "...) &&"
|
||||||
|
|||||||
@ -6,4 +6,13 @@
|
|||||||
>> ) &&
|
>> ) &&
|
||||||
echo ok
|
echo ok
|
||||||
>) |
|
>) |
|
||||||
sort
|
sort &&
|
||||||
|
(
|
||||||
|
bar &&
|
||||||
|
x=$(echo bar |
|
||||||
|
cat
|
||||||
|
>> ) &&
|
||||||
|
y=$(echo baz |
|
||||||
|
>> fip) &&
|
||||||
|
echo fail
|
||||||
|
>)
|
||||||
|
|||||||
@ -6,4 +6,13 @@
|
|||||||
) &&
|
) &&
|
||||||
echo ok
|
echo ok
|
||||||
) |
|
) |
|
||||||
sort
|
sort &&
|
||||||
|
(
|
||||||
|
bar &&
|
||||||
|
x=$(echo bar |
|
||||||
|
cat
|
||||||
|
) &&
|
||||||
|
y=$(echo baz |
|
||||||
|
fip) &&
|
||||||
|
echo fail
|
||||||
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user