@matheusbsbs / matheus-bagliano / commits / 2ed2437a14
Fork 0

grep: use match_pathspec_depth() for cache/worktree grepping

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed Dec 15, 2010 at 22:02 UTC 2ed2437a143391c9e882318874905c964f313977
1 file changed +1 -1
builtin/grep.c
+1 -1
@@ -591,7 +591,7 @@ static int grep_cache(struct grep_opt *opt, const struct pathspec *pathspec, int
591 struct cache_entry *ce = active_cache[nr];
592 if (!S_ISREG(ce->ce_mode))
593 continue;
594 - if (!pathspec_matches(pathspec->raw, ce->name, opt->max_depth))
594 + if (!match_pathspec_depth(pathspec, ce->name, ce_namelen(ce), 0, NULL))
595 continue;
596 /*
597 * If CE_VALID is on, we assume worktree file and its cache entry