Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-03-05 02:02:26 +0300
committerJunio C Hamano <gitster@pobox.com>2011-03-05 02:02:26 +0300
commit63bf941e5a43c343265e836cab2ff2344937e1f6 (patch)
treecd219dd158f1a11669abf4ff5b0db6960aaa7e95
parent501ccd527d6a604f5ad09c1c8d2672ee47d24ccb (diff)
parent9d8b831b36ca936f05e381e0f7f7a4b0d76114ee (diff)
Merge branch 'jc/grep--no-index-pathspec-fix'
* jc/grep--no-index-pathspec-fix: grep --no-index: honor pathspecs correctly
-rw-r--r--builtin/grep.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index c3af8760cc..5afee2f3a4 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -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;