From: Johannes Sixt Date: Thu, 12 May 2011 12:20:23 GMT Subject: Re: [PATCH 3/3] t3503: test cherry picking and reverting root commits Message-ID: <4DCBD087.90302@viscovery.net> In-Reply-To: <20110512111007.GC5292@sigill.intra.peff.net> Am 5/12/2011 13:10, schrieb Jeff King: > +test_expect_success 'cherry-pick a root commit with an external strategy' ' > + > + git cherry-pick --strategy=resolve master && > + test first = $(cat file1) What if file1 does not exist? Then cat fails loudly. But this does not fail the entire command immediately; rather, the test command fails, but not because of a non-equality, but because of an invalid usage ("syntax error"). IOW, the test does the right thing, but for the wrong reason. Yes, an earlier test gave a bad precedent, and the following fixup (to be squashed in) fixes it, too. -- Hannes diff --git a/t/t3503-cherry-pick-root.sh b/t/t3503-cherry-pick-root.sh index 1f9ed67..3006452 100755 --- a/t/t3503-cherry-pick-root.sh +++ b/t/t3503-cherry-pick-root.sh @@ -23,7 +23,7 @@ test_expect_success setup ' test_expect_success 'cherry-pick a root commit' ' git cherry-pick master && - test first = $(cat file1) + test first = "$(cat file1)" ' @@ -37,7 +37,7 @@ test_expect_success 'revert a root commit' ' test_expect_success 'cherry-pick a root commit with an external strategy' ' git cherry-pick --strategy=resolve master && - test first = $(cat file1) + test first = "$(cat file1)" '