From ebb32893bad46bf5edae881552672a47dd2684b8 Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Fri, 24 Jan 2014 20:40:29 +0700 Subject: pathspec: convert some match_pathspec_depth() to dir_path_match() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This helps reduce the number of match_pathspec_depth() call sites and show how m_p_d() is used. And it usage is: - match against an index entry (ce_path_match or match_pathspec_depth in ls-files) - match against a dir_entry from read_directory (dir_path_match and match_pathspec_depth in clean.c, which will be converted later) - resolve-undo (rerere.c and ls-files.c) Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- dir.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'dir.h') diff --git a/dir.h b/dir.h index 42793e582f..65f54b606f 100644 --- a/dir.h +++ b/dir.h @@ -212,4 +212,11 @@ static inline int ce_path_match(const struct cache_entry *ce, return match_pathspec_depth(pathspec, ce->name, ce_namelen(ce), 0, seen); } +static inline int dir_path_match(const struct dir_entry *ent, + const struct pathspec *pathspec, + int prefix, char *seen) +{ + return match_pathspec_depth(pathspec, ent->name, ent->len, prefix, seen); +} + #endif -- cgit v1.2.3