Skip to content

Commit

Permalink
grep --no-index: don't use git standard exclusions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bert Wesarg authored and Junio C Hamano committed Sep 15, 2011
1 parent ac1d33d commit a9e6436
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion builtin-grep.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,6 @@ static int grep_directory(struct grep_opt *opt, const char **paths)
int i, hit = 0;

memset(&dir, 0, sizeof(dir));
setup_standard_excludes(&dir);

fill_directory(&dir, paths);
for (i = 0; i < dir.nr; i++) {
Expand Down
2 changes: 1 addition & 1 deletion t/t7002-grep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,6 @@ test_expect_success 'outside of git repository' '
mkdir -p non/git/sub &&
echo hello >non/git/file1 &&
echo world >non/git/sub/file2 &&
echo ".*o*" >non/git/.gitignore &&
{
echo file1:hello &&
echo sub/file2:world
Expand All @@ -466,6 +465,7 @@ 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.full &&
Expand Down

0 comments on commit a9e6436

Please sign in to comment.