From: Nguyen Thai Ngoc Duy Date: Thu, 07 Jan 2010 13:27:39 GMT Subject: Re: [PATCH 1/2] t7002: set test prerequisite "external-grep" if supported Message-ID: In-Reply-To: <7vy6ka8rmr.fsf@alter.siamese.dyndns.org> On 1/7/10, Junio C Hamano wrote: > So by writing the test to check the desired outcome, instead of writing it > for the particular implementation of using external grep optimization, you > will catch both kinds of breakages. > > Perhaps something like this (untested, of course)? > > test_expect_success 'strings in work tree files are not found for skip-wt paths' ' > no="no such string in the index" && > test_must_fail git grep -e "$no" --cached file && > git update-index --skip-worktree file && > echo "$no" >file && > test_must_fail git grep -e "$no" file && > git update-index --no-skip-worktree file && > git grep -e "$no" file > ' > Very well reasoned. I'd say go for it! Tested-by: me -- Duy