mirror of
https://github.com/git/git
synced 2024-08-28 20:20:07 +00:00
![Eric Sunshine](/assets/img/avatar_default.png)
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>
12 lines
341 B
Plaintext
12 lines
341 B
Plaintext
# LINT: broken &&-chain okay if next command handles "$?" explicitly
|
|
OUT=$( ((large_git; echo $? 1>&3) | :) 3>&1 ) &&
|
|
test_match_signal 13 "$OUT" &&
|
|
|
|
# LINT: broken &&-chain okay if next command handles "$?" explicitly
|
|
{ test-tool sigchain >actual; ret=$?; } &&
|
|
{
|
|
test_match_signal 15 "$ret" ||
|
|
test "$ret" = 3
|
|
} &&
|
|
test_cmp expect actual
|