From: Nguyễn Thái Ngọc Duy Date: Wed, 15 Dec 2010 15:02:52 +0000 (+0700) Subject: grep: use match_pathspec_depth() for cache/worktree grepping X-Git-Tag: v1.7.5-rc0~68^2~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2ed2437a143391c9e882318874905c964f313977;p=git.git grep: use match_pathspec_depth() for cache/worktree grepping Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- diff --git a/builtin/grep.c b/builtin/grep.c index ad9ec4a29..16a2fde94 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -591,7 +591,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