summaryrefslogtreecommitdiff
path: root/builtin/add.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-01-24 13:40:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-02-24 22:37:09 (GMT)
commitebb32893bad46bf5edae881552672a47dd2684b8 (patch)
tree33f26d579d3f3025af77d4dfeefb6a884fb36d1b /builtin/add.c
parent429bb40abdb5b42ffdde5b1a58f9a37da723d179 (diff)
downloadgit-ebb32893bad46bf5edae881552672a47dd2684b8.zip
git-ebb32893bad46bf5edae881552672a47dd2684b8.tar.gz
git-ebb32893bad46bf5edae881552672a47dd2684b8.tar.bz2
pathspec: convert some match_pathspec_depth() to dir_path_match()
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 <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/add.c')
-rw-r--r--builtin/add.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/add.c b/builtin/add.c
index 2a2722f..672adc0 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -208,8 +208,7 @@ static char *prune_directory(struct dir_struct *dir, struct pathspec *pathspec,
i = dir->nr;
while (--i >= 0) {
struct dir_entry *entry = *src++;
- if (match_pathspec_depth(pathspec, entry->name, entry->len,
- prefix, seen))
+ if (dir_path_match(entry, pathspec, prefix, seen))
*dst++ = entry;
else if (flag & WARN_IMPLICIT_DOT)
/*