X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=dir.c;h=570b651a17520cbb0273b9247ab0fcffc0129477;hb=e41f1cb36b71485715941c2abe67d3e184baf061;hp=38f3e3eb9770a9f3d85f175881bd2dd4ced6548b;hpb=b932c3c1c16844af9af2b71790caaca30546e99e;p=git.git diff --git a/dir.c b/dir.c index 38f3e3eb9..570b651a1 100644 --- a/dir.c +++ b/dir.c @@ -253,6 +253,18 @@ static void *read_skip_worktree_file_from_index(const char *path, size_t *size) return data; } +void free_excludes(struct exclude_list *el) +{ + int i; + + for (i = 0; i < el->nr; i++) + free(el->excludes[i]); + free(el->excludes); + + el->nr = 0; + el->excludes = NULL; +} + int add_excludes_from_file_to_list(const char *fname, const char *base, int baselen, @@ -389,13 +401,6 @@ int excluded_from_list(const char *pathname, int to_exclude = x->to_exclude; if (x->flags & EXC_FLAG_MUSTBEDIR) { - if (!dtype) { - if (!prefixcmp(pathname, exclude) && - pathname[x->patternlen] == '/') - return to_exclude; - else - continue; - } if (*dtype == DT_UNKNOWN) *dtype = get_dtype(NULL, pathname, pathlen); if (*dtype != DT_DIR)