@matheusbsbs / matheus-bagliano / commits / c6720cfa49
Fork 0

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>

Junio C Hamano committed Jun 21, 2009 at 02:01 UTC c6720cfa49fde6d78b010c088a476d226d161983
1 file changed +5 -5
t/t3505-cherry-pick-empty.sh
+5 -5
@@ -17,11 +17,11 @@ test_expect_success setup '
17
18 '
19
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 + }
25 '
26
27 test_expect_success 'index lockfile was removed' '