Skip to content

Commit

Permalink
Merge branch 'jc/grep--no-index-pathspec-fix'
Browse files Browse the repository at this point in the history
* jc/grep--no-index-pathspec-fix:
  grep --no-index: honor pathspecs correctly
  • Loading branch information
Junio C Hamano committed Mar 4, 2011
2 parents 501ccd5 + 9d8b831 commit 63bf941
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions builtin/grep.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,10 @@ static int grep_directory(struct grep_opt *opt, const struct pathspec *pathspec)

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;
Expand Down

0 comments on commit 63bf941

Please sign in to comment.