]> git.ipfire.org Git - thirdparty/git.git/commit
chainlint.pl: don't flag broken &&-chain if `$?` handled explicitly
authorEric Sunshine <sunshine@sunshineco.com>
Thu, 1 Sep 2022 00:29:48 +0000 (00:29 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 1 Sep 2022 17:07:41 +0000 (10:07 -0700)
commita8f30ee0502b89ecb660af36784f653a8c3fb20d
tree35840694c510b0290bdc2f9a0a7b5df565ef879f
parentaabc3258a1da5f06e0b2492f450d4b8e7e8137e5
chainlint.pl: don't flag broken &&-chain if `$?` handled explicitly

There are cases in which tests capture and check a command's exit code
explicitly without employing test_expect_code(). They do so by
intentionally breaking the &&-chain since it would be impossible to
capture "$?" in the failing case if the `status=$?` assignment was part
of the &&-chain. Since such constructs are manually checking the exit
code, their &&-chain breakage is legitimate and safe, thus should not be
flagged. Therefore, stop flagging &&-chain breakage in such cases.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/chainlint.pl
t/chainlint/chain-break-status.expect [new file with mode: 0644]
t/chainlint/chain-break-status.test [new file with mode: 0644]