X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin%2Fgrep.c;h=16a2fde9477c4c99f0342f156c4e767ef253c203;hb=2ed2437a143391c9e882318874905c964f313977;hp=ad9ec4a29967bccc1c63447003acb75df94ef0f6;hpb=f34bbc15ce0749a3e9f749f0fef6c486e1482719;p=git.git 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