Skip to content

Commit c6720cf

Browse files
committed
t3505: fix abuse of test_expect_code
The test wanted to make sure that cherry-pick exits with status 1, but with the way it was placed after "git checkout master &&" meant that it could have misjudged success if checkout barfed with the same failure status. Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 3ba4f3a commit c6720cf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

t/t3505-cherry-pick-empty.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ test_expect_success setup '
1717
1818
'
1919

20-
test_expect_code 1 'cherry-pick an empty commit' '
21-
22-
git checkout master &&
23-
git cherry-pick empty-branch
24-
20+
test_expect_success 'cherry-pick an empty commit' '
21+
git checkout master && {
22+
git cherry-pick empty-branch
23+
test "$?" = 1
24+
}
2525
'
2626

2727
test_expect_success 'index lockfile was removed' '

0 commit comments

Comments
 (0)