diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-11-18 19:32:30 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-11-18 19:32:30 -0800 |
commit | dca5ed5f5b2646186ce177bb41974035f8fefd52 (patch) | |
tree | d1289a994fbcc01b35c7cf058878fb92c110831f /t | |
parent | Merge branch 'jc/grep-pcre-loose-ends' (early part) into maint (diff) | |
parent | grep: stop looking at random places for .gitattributes (diff) | |
download | tgif-dca5ed5f5b2646186ce177bb41974035f8fefd52.tar.xz |
Merge branch 'nd/grep-true-path' into maint
"git grep -e pattern <tree>" asked the attribute system to read
"<tree>:.gitattributes" file in the working tree, which was
nonsense.
* nd/grep-true-path:
grep: stop looking at random places for .gitattributes
Diffstat (limited to 't')
-rwxr-xr-x | t/t7008-grep-binary.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t7008-grep-binary.sh b/t/t7008-grep-binary.sh index fd6410fc71..26f831984d 100755 --- a/t/t7008-grep-binary.sh +++ b/t/t7008-grep-binary.sh @@ -111,6 +111,28 @@ test_expect_success 'grep respects binary diff attribute' ' test_cmp expect actual ' +test_expect_success 'grep --cached respects binary diff attribute' ' + git grep --cached text t >actual && + test_cmp expect actual +' + +test_expect_success 'grep --cached respects binary diff attribute (2)' ' + git add .gitattributes && + rm .gitattributes && + git grep --cached text t >actual && + test_when_finished "git rm --cached .gitattributes" && + test_when_finished "git checkout .gitattributes" && + test_cmp expect actual +' + +test_expect_success 'grep revision respects binary diff attribute' ' + git commit -m new && + echo "Binary file HEAD:t matches" >expect && + git grep text HEAD -- t >actual && + test_when_finished "git reset HEAD^" && + test_cmp expect actual +' + test_expect_success 'grep respects not-binary diff attribute' ' echo binQary | q_to_nul >b && git add b && |