From 74d2f5695dab4454097b2d1693f7206e8328724a Mon Sep 17 00:00:00 2001 From: Eric Sunshine Date: Thu, 9 Dec 2021 00:11:06 -0500 Subject: tests: fix broken &&-chains in compound statements The top-level &&-chain checker built into t/test-lib.sh causes tests to magically exit with code 117 if the &&-chain is broken. However, it has the shortcoming that the magic does not work within `{...}` groups, `(...)` subshells, `$(...)` substitutions, or within bodies of compound statements, such as `if`, `for`, `while`, `case`, etc. `chainlint.sed` partly fills in the gap by catching broken &&-chains in `(...)` subshells, but bugs can still lurk behind broken &&-chains in the other cases. Fix broken &&-chains in compound statements in order to reduce the number of possible lurking bugs. Signed-off-by: Eric Sunshine Reviewed-by: Elijah Newren Signed-off-by: Junio C Hamano --- t/t1300-config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/t1300-config.sh') diff --git a/t/t1300-config.sh b/t/t1300-config.sh index 9ff46f3b04..9571649c42 100755 --- a/t/t1300-config.sh +++ b/t/t1300-config.sh @@ -717,7 +717,7 @@ test_expect_success bool ' rm -f result && for i in 1 2 3 4 do - git config --bool --get bool.true$i >>result + git config --bool --get bool.true$i >>result && git config --bool --get bool.false$i >>result done && test_cmp expect result' -- cgit v1.2.3