From: Junio C Hamano Date: Fri, 14 Oct 2011 02:03:18 +0000 (-0700) Subject: Merge branch 'bw/grep-no-index-no-exclude' X-Git-Tag: v1.7.8-rc0~89 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6fdab32e14e2bca05ae6471502bcdfd35b381564;p=git.git Merge branch 'bw/grep-no-index-no-exclude' * bw/grep-no-index-no-exclude: grep --no-index: don't use git standard exclusions grep: do not use --index in the short usage output --- 6fdab32e14e2bca05ae6471502bcdfd35b381564 diff --cc builtin/grep.c index a286692e4,a10946db3..91c3a852f --- a/builtin/grep.c +++ b/builtin/grep.c @@@ -646,14 -652,9 +646,13 @@@ static int grep_directory(struct grep_o int i, hit = 0; memset(&dir, 0, sizeof(dir)); - setup_standard_excludes(&dir); - fill_directory(&dir, paths); + fill_directory(&dir, pathspec->raw); for (i = 0; i < dir.nr; i++) { + const char *name = dir.entries[i]->name; + int namelen = strlen(name); + if (!match_pathspec_depth(pathspec, name, namelen, 0, NULL)) + continue; hit |= grep_file(opt, dir.entries[i]->name); if (hit && opt->status_only) break;