Re: [PATCHv5 07/16] t3600 (rm): add lots of missing &&

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Oct 3, 2010 at 8:28 AM, Jonathan Nieder <jrnieder@xxxxxxxxx> wrote:
>> --- 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]