Skip to content

Commit 500317a

Browse files
j6tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e7e5c6f commit 500317a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t3920-crlf-messages.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ create_crlf_ref () {
1212
cat >.crlf-orig-$branch.txt &&
1313
cat .crlf-orig-$branch.txt | append_cr >.crlf-message-$branch.txt &&
1414
grep 'Subject' .crlf-orig-$branch.txt | tr '\n' ' ' | sed 's/[ ]*$//' | tr -d '\n' >.crlf-subject-$branch.txt &&
15-
grep 'Body' .crlf-message-$branch.txt >.crlf-body-$branch.txt || true &&
15+
{ grep 'Body' .crlf-message-$branch.txt >.crlf-body-$branch.txt || true; } &&
1616
LIB_CRLF_BRANCHES="${LIB_CRLF_BRANCHES} ${branch}" &&
1717
test_tick &&
1818
hash=$(git commit-tree HEAD^{tree} -p HEAD -F .crlf-message-${branch}.txt) &&

0 commit comments

Comments
 (0)