diff options
author | Eric Sunshine <sunshine@sunshineco.com> | 2022-08-22 21:26:40 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-08-22 22:53:02 +0300 |
commit | 308cbaa0829f6c039728b521153e63928934681e (patch) | |
tree | 0d680ebe5e341779a6f25d81f5ad45d58858b0c8 /t/t2407-worktree-heads.sh | |
parent | 795ea8776befc95ea2becd8020c7a284677b4161 (diff) |
t2407: fix broken &&-chains in compound statement
The breaks in the &&-chain in this test went unnoticed because the
"magic exit code 117" &&-chain checker built into test-lib.sh only
recognizes broken &&-chains at the top-level; it does not work within
`{...}` groups, `(...)` subshells, `$(...)` substitutions, or within
bodies of compound statements, such as `if`, `for`, `while`, `case`,
etc. Furthermore, `chainlint.sed` detects broken &&-chains only in
`(...)` subshells. Thus, the &&-chain breaks in this test fall into the
blind spots of the &&-chain linters.
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t2407-worktree-heads.sh')
-rwxr-xr-x | t/t2407-worktree-heads.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t2407-worktree-heads.sh b/t/t2407-worktree-heads.sh index 50815acd3e..019a40df2c 100755 --- a/t/t2407-worktree-heads.sh +++ b/t/t2407-worktree-heads.sh @@ -41,10 +41,10 @@ test_expect_success 'setup' ' test_expect_success 'refuse to overwrite: checked out in worktree' ' for i in 1 2 3 4 do - test_must_fail git branch -f wt-$i HEAD 2>err + test_must_fail git branch -f wt-$i HEAD 2>err && grep "cannot force update the branch" err && - test_must_fail git branch -D wt-$i 2>err + test_must_fail git branch -D wt-$i 2>err && grep "Cannot delete branch" err || return 1 done ' |