tvl-depot/third_party/git/t/chainlint/exit-loop.test
Vincent Ambo 7ef0d62730 merge(third_party/git): Merge squashed git subtree at v2.23.0
Merge commit '1b593e1ea4d2af0f6444d9a7788d5d99abd6fde5' as 'third_party/git'
2020-01-11 23:40:29 +00:00

27 lines
424 B
Text

(
for i in a b c
do
# LINT: "|| exit {n}" valid for-loop escape in subshell; no "&&" needed
foo || exit 1
bar &&
baz
done
) &&
(
while true
do
# LINT: "|| exit {n}" valid while-loop escape in subshell; no "&&" needed
foo || exit 1
bar &&
baz
done
) &&
(
i=0 &&
while test $i -lt 10
do
# LINT: "|| exit" (sans exit code) valid escape in subshell; no "&&" needed
echo $i || exit
i=$(($i + 1))
done
)