| * Copyright (C) 2005 Junio C Hamano |
| static int matches_pathspec(const char *name, struct path_spec *s, int cnt) |
| for (i = 0; i < cnt; i++) { |
| if (memcmp(s[i].spec, name, len)) |
| if (s[i].spec[len-1] == '/' || |
| void diffcore_pathspec(const char **pathspec) |
| struct diff_queue_struct *q = &diff_queued_diff; |
| struct diff_queue_struct outq; |
| outq.nr = outq.alloc = 0; |
| for (i = 0; pathspec[i]; i++) |
| spec = xmalloc(sizeof(*spec) * speccnt); |
| for (i = 0; pathspec[i]; i++) { |
| spec[i].spec = pathspec[i]; |
| spec[i].len = strlen(pathspec[i]); |
| for (i = 0; i < q->nr; i++) { |
| struct diff_filepair *p = q->queue[i]; |
| if (matches_pathspec(p->two->path, spec, speccnt)) |