From ac48adf488794417b1060b5ed2377a9fd4c33c17 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Fri, 24 Feb 2023 00:09:31 +0000 Subject: dir.h: refactor to no longer need to include cache.h Moving a few functions around allows us to make dir.h no longer need to include cache.h. This commit is best viewed with: git log -1 -p --color-moved Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- dir.h | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'dir.h') diff --git a/dir.h b/dir.h index 8acfc04418..fc4386ae50 100644 --- a/dir.h +++ b/dir.h @@ -1,8 +1,9 @@ #ifndef DIR_H #define DIR_H -#include "cache.h" #include "hashmap.h" +#include "pathspec.h" +#include "statinfo.h" #include "strbuf.h" /** @@ -363,10 +364,6 @@ int count_slashes(const char *s); int simple_length(const char *match); int no_wildcard(const char *string); char *common_prefix(const struct pathspec *pathspec); -int match_pathspec(struct index_state *istate, - const struct pathspec *pathspec, - const char *name, int namelen, - int prefix, char *seen, int is_dir); int report_path_error(const char *ps_matched, const struct pathspec *pathspec); int within_depth(const char *name, int namelen, int depth, int max_depth); @@ -533,15 +530,6 @@ int submodule_path_match(struct index_state *istate, const char *submodule_name, char *seen); -static inline int ce_path_match(struct index_state *istate, - const struct cache_entry *ce, - const struct pathspec *pathspec, - char *seen) -{ - return match_pathspec(istate, pathspec, ce->name, ce_namelen(ce), 0, seen, - S_ISDIR(ce->ce_mode) || S_ISGITLINK(ce->ce_mode)); -} - static inline int dir_path_match(struct index_state *istate, const struct dir_entry *ent, const struct pathspec *pathspec, -- cgit v1.2.3