Re: [PATCHv5 07/16] t3600 (rm): add lots of missing &&
- From
Elijah Newren <newren@gmail.com>
- Date
- Oct 3, 2010, 19:37 UTC
- Message-ID
- <AANLkTinYkq+e5gPxRMSNHqk9zqyku+NPpUYXJMXL0R_0@mail.gmail.com>
- In-Reply-To
- <20101003142855.GC17084@burratino>
On Sun, Oct 3, 2010 at 8:28 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 22 quoted lines
>> --- a/t/t3600-rm.sh >> +++ b/t/t3600-rm.sh >> @@ -38,37 +38,33 @@ test_expect_success \ > [...] >> 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 >> + git checkout HEAD -- foo && > [...] > > Why not > > - echo content > foo > - git add foo > - git commit -m foo > + echo content > foo && > + git add foo && > + git commit --allow-empty -m foo && > > ?
What advantage does using these three commands have over 'git checkout HEAD -- foo'? Perhaps I'm missing something, but I don't see it. It's three commands to one, and the tests don't depend on foo starting with contents of 'content'; just that foo matches HEAD to start.
However, I'm fine with this alternative as well, if others prefer it.