summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-10-13 19:03:23 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-10-13 19:03:23 -0700
commitab1e76b88c836b16f37083910a4b1844fb4ddaca (patch)
tree1c4363d4f2139c0e6d6315bf951d5da92190075f /t
parentMerge branch 'rs/diff-cleanup-records-fix' (diff)
parentMerge branch 'jc/maint-grep-untracked-exclude' into jc/grep-untracked-exclude (diff)
downloadtgif-ab1e76b88c836b16f37083910a4b1844fb4ddaca.tar.xz
Merge branch 'jc/grep-untracked-exclude'
* jc/grep-untracked-exclude: grep: teach --untracked and --exclude-standard options
Diffstat (limited to 't')
-rwxr-xr-xt/t7810-grep.sh34
1 files changed, 33 insertions, 1 deletions
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index 4a05e79cae..81263b7851 100755
--- a/t/t7810-grep.sh
+++ b/t/t7810-grep.sh
@@ -570,6 +570,23 @@ test_expect_success 'outside of git repository' '
test_must_fail git grep o &&
git grep --no-index o >../../actual.sub &&
test_cmp ../../expect.sub ../../actual.sub
+ ) &&
+
+ echo ".*o*" >non/git/.gitignore &&
+ (
+ GIT_CEILING_DIRECTORIES="$(pwd)/non/git" &&
+ export GIT_CEILING_DIRECTORIES &&
+ cd non/git &&
+ test_must_fail git grep o &&
+ git grep --no-index --exclude-standard o >../actual.full &&
+ test_cmp ../expect.full ../actual.full &&
+
+ {
+ echo ".gitignore:.*o*"
+ cat ../expect.full
+ } >../expect.with.ignored &&
+ git grep --no-index --no-exclude o >../actual.full &&
+ test_cmp ../expect.with.ignored ../actual.full
)
'
@@ -580,9 +597,12 @@ test_expect_success 'inside git repository but with --no-index' '
echo world >is/git/sub/file2 &&
echo ".*o*" >is/git/.gitignore &&
{
- echo ".gitignore:.*o*" &&
echo file1:hello &&
echo sub/file2:world
+ } >is/expect.unignored &&
+ {
+ echo ".gitignore:.*o*" &&
+ cat is/expect.unignored
} >is/expect.full &&
: >is/expect.empty &&
echo file2:world >is/expect.sub &&
@@ -591,12 +611,24 @@ test_expect_success 'inside git repository but with --no-index' '
git init &&
test_must_fail git grep o >../actual.full &&
test_cmp ../expect.empty ../actual.full &&
+
+ git grep --untracked o >../actual.unignored &&
+ test_cmp ../expect.unignored ../actual.unignored &&
+
git grep --no-index o >../actual.full &&
test_cmp ../expect.full ../actual.full &&
+
+ git grep --no-index --exclude-standard o >../actual.unignored &&
+ test_cmp ../expect.unignored ../actual.unignored &&
+
cd sub &&
test_must_fail git grep o >../../actual.sub &&
test_cmp ../../expect.empty ../../actual.sub &&
+
git grep --no-index o >../../actual.sub &&
+ test_cmp ../../expect.sub ../../actual.sub &&
+
+ git grep --untracked o >../../actual.sub &&
test_cmp ../../expect.sub ../../actual.sub
)
'