diff options
author | Eric Sunshine <sunshine@sunshineco.com> | 2021-12-13 07:30:52 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-13 23:15:29 +0100 |
commit | 3865a7e36dd762f57860faac0d1a1aa9c52d9404 (patch) | |
tree | 03bae34f1bbced9d60b415485f20c176c656c8a7 /t/chainlint | |
parent | chainlint.sed: improve ?!SEMI?! placement accuracy (diff) | |
download | git-3865a7e36dd762f57860faac0d1a1aa9c52d9404.tar.xz git-3865a7e36dd762f57860faac0d1a1aa9c52d9404.zip |
chainlint.sed: tolerate harmless ";" at end of last line in block
chainlint.sed flags ";" when used as a command terminator since it
breaks the &&-chain, thus can allow failures to go undetected. However,
when a command terminated by ";" is the last command in the body of a
compound statement, such as `command-2` in:
if test $# -gt 1
then
command-1 &&
command-2;
fi
then the ";" is harmless and the exit code from `command-2` is passed
through untouched and becomes the exit code of the compound statement,
as if the ";" was not present. Therefore, tolerate a trailing ";" in
this position rather than complaining about broken &&-chain.
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/semicolon.expect | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/t/chainlint/semicolon.expect b/t/chainlint/semicolon.expect index d2d804f5b0..0e6389f532 100644 --- a/t/chainlint/semicolon.expect +++ b/t/chainlint/semicolon.expect @@ -11,10 +11,10 @@ cat foo; ?!SEMI?! echo bar >) && ( - foo; ?!SEMI?! + foo; >) && ( cd foo && for i in a b c; do - echo; ?!SEMI?! + echo; > done) |