summaryrefslogtreecommitdiff
path: root/dir.h
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-12-15 22:02:48 +0700
committerJunio C Hamano <gitster@pobox.com>2011-02-03 14:08:30 -0800
commit61cf28204508c095a68e7a9cb6307ca2a27112c9 (patch)
tree35af9a9a7212ad699ec5238ac2785b668725bffd /dir.h
parentf1a2ddbbc2df4e81e005a7e82f9e23fb6a9f95e3 (diff)
downloadgit-61cf28204508c095a68e7a9cb6307ca2a27112c9.tar.gz
pathspec: add match_pathspec_depth()
match_pathspec_depth() is a clone of match_pathspec() except that it can take depth limit. Computation is a bit lighter compared to match_pathspec() because it's usually precomputed and stored in struct pathspec. In long term, match_pathspec() and match_one() should be removed in favor of this function. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.h')
-rw-r--r--dir.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/dir.h b/dir.h
index 5fa3fbe4c5..aa511da77b 100644
--- a/dir.h
+++ b/dir.h
@@ -65,6 +65,9 @@ struct dir_struct {
#define MATCHED_FNMATCH 2
#define MATCHED_EXACTLY 3
extern int match_pathspec(const char **pathspec, const char *name, int namelen, int prefix, char *seen);
+extern int match_pathspec_depth(const struct pathspec *pathspec,
+ const char *name, int namelen,
+ int prefix, char *seen);
extern int within_depth(const char *name, int namelen, int depth, int max_depth);
extern int fill_directory(struct dir_struct *dir, const char **pathspec);