Re: [PATCH] Convert "! git" to "test_must_fail" git.
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Jul 20, 2010, 19:48 UTC
- Message-ID
- <20100720194807.GA2259@burratino>
- In-Reply-To
- <_BUqzkdWhTIktk0rYFvr9jdvISwfrShKmEsXaqgCBwm0X5Urcv2osQ@cipher.nrlssc.navy.mil>
Brandon Casey wrote:
> I believe the '!' negates the > result of the entire statement, but test_must_fail only > operates on the arguments preceding the '|'.
Right. For example:
> On 07/20/2010 02:09 PM, Jared Hance wrote:
[...]
Show 7 quoted lines
>> +++ b/t/t7810-grep.sh >> @@ -134,7 +134,7 @@ do >> ' >> >> test_expect_success "grep -c $L (no /dev/null)" ' >> - ! git grep -c test $H | grep /dev/null >> + test_must_fail git grep -c test $H | grep /dev/null
should be
git grep -c test $H | ! grep /dev/null
or if it is considered important to test the exit code of git grep,
git grep -c test $H >actual && ! grep /dev/null actual
Regards, Jonathan