Skip to content

Commit 308cbaa

Browse files
sunshinecogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 795ea87 commit 308cbaa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/t2407-worktree-heads.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ test_expect_success 'setup' '
4141
test_expect_success 'refuse to overwrite: checked out in worktree' '
4242
for i in 1 2 3 4
4343
do
44-
test_must_fail git branch -f wt-$i HEAD 2>err
44+
test_must_fail git branch -f wt-$i HEAD 2>err &&
4545
grep "cannot force update the branch" err &&
4646
47-
test_must_fail git branch -D wt-$i 2>err
47+
test_must_fail git branch -D wt-$i 2>err &&
4848
grep "Cannot delete branch" err || return 1
4949
done
5050
'

0 commit comments

Comments
 (0)