From 0fd0e2417d383168b6a510f78c754298435a89ce Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Sat, 27 Nov 2010 01:17:44 +0700 Subject: dir.c: add free_excludes() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- dir.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'dir.c') diff --git a/dir.c b/dir.c index b2dfb69eb5..39eb7a3a4f 100644 --- a/dir.c +++ b/dir.c @@ -223,6 +223,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, -- cgit 1.2.3-korg From 9e082734b3a7c2685c1593dae8dca1e73568d51c Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Sat, 27 Nov 2010 01:17:47 +0700 Subject: Revert "excluded_1(): support exclude files in index" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c84de70781674a35b9bfd20aa5bc8c47582615df. The commit provided a workaround for matching directories in index. But it is no longer needed. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- dir.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'dir.c') diff --git a/dir.c b/dir.c index 39eb7a3a4f..d059aa1e6e 100644 --- a/dir.c +++ b/dir.c @@ -371,13 +371,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) -- cgit 1.2.3-korg