summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eb9cb55)
raw | patch | inline | side by side (parent: eb9cb55)
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Wed, 15 Dec 2010 15:02:50 +0000 (22:02 +0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 3 Feb 2011 22:08:30 +0000 (14:08 -0800) |
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c | patch | blob | history |
diff --git a/read-cache.c b/read-cache.c
index 8b2d537f0253ef33b0cd7bb90ec8f6f47b5b8307..7772079ad3101a2a51cfef1c5b1c250ed3ff37de 100644 (file)
--- a/read-cache.c
+++ b/read-cache.c
int ce_path_match(const struct cache_entry *ce, const struct pathspec *pathspec)
{
- const char *match, *name;
- const char **ps = pathspec->raw;
- int len;
-
- if (!pathspec->nr)
- return 1;
-
- len = ce_namelen(ce);
- name = ce->name;
- while ((match = *ps++) != NULL) {
- int matchlen = strlen(match);
- if (matchlen > len)
- continue;
- if (memcmp(name, match, matchlen))
- continue;
- if (matchlen && name[matchlen-1] == '/')
- return 1;
- if (name[matchlen] == '/' || !name[matchlen])
- return 1;
- if (!matchlen)
- return 1;
- }
- return 0;
+ return match_pathspec_depth(pathspec, ce->name, ce_namelen(ce), 0, NULL);
}
/*