Thread (25 messages) 25 messages, 2 authors, 2019-02-04

[PATCH 17/21] grep: use match_pathspec_depth() for cache/worktree grepping

flat view
STALE2811d

From: Nguyễn Thái Ngọc Duy <hidden>
Date: 2016-06-15 22:50:15
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
---
 builtin/grep.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin/grep.c b/builtin/grep.c
index 4179af8..fbc7d02 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -595,7 +595,7 @@ static int grep_cache(struct grep_opt *opt, const struct pathspec *pathspec, int
 		struct cache_entry *ce = active_cache[nr];
 		if (!S_ISREG(ce->ce_mode))
 			continue;
-		if (!pathspec_matches(pathspec->raw, ce->name, opt->max_depth))
+		if (!match_pathspec_depth(pathspec, ce->name, ce_namelen(ce), 0, NULL))
 			continue;
 		/*
 		 * If CE_VALID is on, we assume worktree file and its cache entry
-- 
1.7.3.3.476.g10a82
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help