mirror of
https://github.com/git/git.git
synced 2026-03-17 12:10:08 +01:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
4c117786da
commit
06e3e10950
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user