Skip to content

Commit a9e6436

Browse files
bertwesarggitster
authored andcommitted
grep --no-index: don't use git standard exclusions
The --no-index mode is intended to be used outside of a git repository, and it does not make sense to apply the git standard exclusions outside a git repositories. Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent ac1d33d commit a9e6436

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

builtin-grep.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,6 @@ static int grep_directory(struct grep_opt *opt, const char **paths)
652652
int i, hit = 0;
653653

654654
memset(&dir, 0, sizeof(dir));
655-
setup_standard_excludes(&dir);
656655

657656
fill_directory(&dir, paths);
658657
for (i = 0; i < dir.nr; i++) {

t/t7002-grep.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,6 @@ test_expect_success 'outside of git repository' '
439439
mkdir -p non/git/sub &&
440440
echo hello >non/git/file1 &&
441441
echo world >non/git/sub/file2 &&
442-
echo ".*o*" >non/git/.gitignore &&
443442
{
444443
echo file1:hello &&
445444
echo sub/file2:world
@@ -466,6 +465,7 @@ test_expect_success 'inside git repository but with --no-index' '
466465
echo world >is/git/sub/file2 &&
467466
echo ".*o*" >is/git/.gitignore &&
468467
{
468+
echo ".gitignore:.*o*" &&
469469
echo file1:hello &&
470470
echo sub/file2:world
471471
} >is/expect.full &&

0 commit comments

Comments
 (0)