From: Ævar Arnfjörð Bjarmason Date: Fri, 24 Sep 2010 22:58:32 GMT Subject: Re: [RFC PATCHv2 07/16] t3600 (rm): add lots of missing && Message-ID: In-Reply-To: <1285366976-22216-8-git-send-email-newren@gmail.com> On Fri, Sep 24, 2010 at 22:22, Elijah Newren wrote: > FIXME: I had to modify a few of the tests to make them pass again.  Are my > modifications okay?  Would a different method be preferred? >  test_expect_success \ >     'Test that git rm --cached foo succeeds if the index matches the file' \ > -    'echo content > foo > -     git add foo > -     git commit -m foo > -     echo "other content" > foo > +    'echo content > foo && > +     git add foo && > +     git commit -m foo && > +     echo "other content" > foo && >      git rm --cached foo' > >  test_expect_success \ >     'Test that git rm --cached foo fails if the index matches neither the file nor HEAD' ' > -     echo content > foo > -     git add foo > -     git commit -m foo > -     echo "other content" > foo > -     git add foo > -     echo "yet another content" > foo > +     git checkout HEAD -- foo && > +     echo "other content" > foo && > +     git add foo && > +     echo "yet another content" > foo && >      test_must_fail git rm --cached foo >  ' Shouldn't that be: test_when_finished "git checkout HEAD -- foo" && git rm --cached foo In the above test? Then you don't have to clean up after someone else's mess, and the tests are more self-contained.