diff options
| author | Johannes Sixt <j6t@kdbg.org> | 2022-11-21 18:58:13 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-12-05 10:02:34 +0900 |
| commit | 500317ae03f635b247627eeb9760d9de2e343875 (patch) | |
| tree | 20e0aeaa6d9cb9577f6b916d31a6834e881010e5 | |
| parent | e7e5c6f715b2de7bea0d39c7d2ba887335b40aa0 (diff) | |
| download | git-500317ae03f635b247627eeb9760d9de2e343875.tar.xz | |
t3920: don't ignore errors of more than one command with `|| true`
It is customary to write `A || true` to ignore a potential error exit of
command A. But when we have a sequence `A && B && C || true && D`, then
a failure of any of A, B, or C skips to D right away. This is not
intended here. Turn the command whose failure is to be ignored into a
compound command to ensure it is the only one that is allowed to fail.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
| -rwxr-xr-x | t/t3920-crlf-messages.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t3920-crlf-messages.sh b/t/t3920-crlf-messages.sh index 4c661d4d54..a58522c163 100755 --- a/t/t3920-crlf-messages.sh +++ b/t/t3920-crlf-messages.sh @@ -12,7 +12,7 @@ create_crlf_ref () { cat >.crlf-orig-$branch.txt && cat .crlf-orig-$branch.txt | append_cr >.crlf-message-$branch.txt && grep 'Subject' .crlf-orig-$branch.txt | tr '\n' ' ' | sed 's/[ ]*$//' | tr -d '\n' >.crlf-subject-$branch.txt && - grep 'Body' .crlf-message-$branch.txt >.crlf-body-$branch.txt || true && + { grep 'Body' .crlf-message-$branch.txt >.crlf-body-$branch.txt || true; } && LIB_CRLF_BRANCHES="${LIB_CRLF_BRANCHES} ${branch}" && test_tick && hash=$(git commit-tree HEAD^{tree} -p HEAD -F .crlf-message-${branch}.txt) && |
