summaryrefslogtreecommitdiff
path: root/diff-cache.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-07-14 23:55:06 (GMT)
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-14 23:55:06 (GMT)
commitc0fd1f517efeb67df32b8d4ffa209afab14be436 (patch)
tree007728a4e0c2572196e5b118761bf69fdea5bfd8 /diff-cache.c
parentfdee7d07ba6c79b3e5125e96adbe1d9c3e75ce1d (diff)
downloadgit-c0fd1f517efeb67df32b8d4ffa209afab14be436.zip
git-c0fd1f517efeb67df32b8d4ffa209afab14be436.tar.gz
git-c0fd1f517efeb67df32b8d4ffa209afab14be436.tar.bz2
Make "ce_match_path()" a generic helper function
... and make git-diff-files use it too. This all _should_ make the diffcore-pathspec.c phase unnecessary, since the diff'ers now all do the path matching early interally.
Diffstat (limited to 'diff-cache.c')
-rw-r--r--diff-cache.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/diff-cache.c b/diff-cache.c
index 37c6eb5..e6373b3 100644
--- a/diff-cache.c
+++ b/diff-cache.c
@@ -87,28 +87,6 @@ static int show_modified(struct cache_entry *old,
return 0;
}
-static int ce_path_match(const struct cache_entry *ce, const char **pathspec)
-{
- const char *match, *name;
- int len;
-
- if (!pathspec)
- return 1;
-
- len = ce_namelen(ce);
- name = ce->name;
- while ((match = *pathspec++) != NULL) {
- int matchlen = strlen(match);
- if (matchlen > len)
- continue;
- if (memcmp(name, match, matchlen))
- continue;
- if (name[matchlen] == '/' || !name[matchlen])
- return 1;
- }
- return 0;
-}
-
static int diff_cache(struct cache_entry **ac, int entries, const char **pathspec)
{
while (entries) {