Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'jc/grep--no-index-pathspec-fix'
author
Junio C Hamano
<gitster@pobox.com>
Fri, 4 Mar 2011 23:02:26 +0000
(15:02 -0800)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 4 Mar 2011 23:02:26 +0000
(15:02 -0800)
* jc/grep--no-index-pathspec-fix:
grep --no-index: honor pathspecs correctly
builtin/grep.c
patch
|
blob
|
history
raw
(from parent 1:
501ccd5
)
diff --git
a/builtin/grep.c
b/builtin/grep.c
index c3af8760cc778b4eb835d4fb543f45aa333b214c..5afee2f3a42c76c7e414a667e04c10dd87af1a6a 100644
(file)
--- 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;