{"thread":{"id":"19884","subject":"[PATCH] t3505: fix abuse of test_expect_code","startedAt":"2009-06-21T09:14:17Z","lastAt":"2009-06-21T09:14:17Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"116709","messageId":"7v7hz6t0d2.fsf@alter.siamese.dyndns.org","threadId":"19884","inReplyTo":null,"subject":"[PATCH] t3505: fix abuse of test_expect_code","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-21T09:14:17Z","receivedAt":"2009-06-21T09:14:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The test wanted to make sure that cherry-pick exits with status 1,\nbut with the way it was placed after \"git checkout master &&\" meant\nthat it could have misjudged success if checkout barfed with the\nsame failure status.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * Besides, /bin/sh (but not bash) on FreeBSD 7.2 does not seem to\n   evaluate \"a && b\" fed to test_expect_code correctly for me (eval_ret=0\n   for some reason, even though cherry-pick was failing), and this patch\n   incidentally fixes that issue.\n\n t/t3505-cherry-pick-empty.sh |   10 +++++-----\n 1 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t3505-cherry-pick-empty.sh b/t/t3505-cherry-pick-empty.sh\nindex 9aaeabd..e51e505 100755\n--- a/t/t3505-cherry-pick-empty.sh\n+++ b/t/t3505-cherry-pick-empty.sh\n@@ -17,11 +17,11 @@ test_expect_success setup '\n \n '\n \n-test_expect_code 1 'cherry-pick an empty commit' '\n-\n-\tgit checkout master &&\n-\tgit cherry-pick empty-branch\n-\n+test_expect_success 'cherry-pick an empty commit' '\n+\tgit checkout master && {\n+\t\tgit cherry-pick empty-branch\n+\t\ttest \"$?\" = 1\n+\t}\n '\n \n test_expect_success 'index lockfile was removed' '\n"}]}