Re: [PATCH v2 2/2] grep: stop looking at random places for .gitattributes
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Oct 10, 2012, 14:21 UTC
- Message-ID
- <50758477.3030304@viscovery.net>
- In-Reply-To
- <1349877544-17648-3-git-send-email-pclouds@gmail.com>
Am 10/10/2012 15:59, schrieb Nguyễn Thái Ngọc Duy:
> This patch passes real paths down to grep_source_load_driver(). Except > grepping a blob, all other cases should have right paths down to
... grepping a blob or tree object...
> grep_source_load_driver(). In other words, .gitattributes are still > respected.
...
Show 8 quoted lines
> +test_expect_success 'grep --cached respects binary diff attribute (2)' ' > + git add .gitattributes && > + rm .gitattributes && > + git grep --cached text t >actual && > + test_cmp expect actual && > + git checkout .gitattributes && > + git rm --cached .gitattributes > +'
This should perhaps be test_when_finished "git rm --cached .gitattributes".
> + > +test_expect_success 'grep tree respects binary diff attribute' '
I was confused by the word "tree" here. Isn't "pathspec" more correct?
Show 6 quoted lines
> + git commit -m new && > + echo "Binary file HEAD:t matches" >expect && > + git grep text HEAD -- t >actual && > + test_cmp expect actual && > + git reset HEAD^ > +'
And in yet another test, should
git grep text HEAD:t
/not/ respect the binary attribute?
At any rate, I don't observe the warnings anymore with this series.
Thanks, -- Hannes