summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-12-22 22:40:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-12-22 22:40:26 (GMT)
commite39212ab08e8d37dda5d8fd32b54099fe01dbbdb (patch)
treeacfce393969ebf4d2404a4619c84553e761803e7 /dir.c
parent716958c9a23cbb4bf671dc89e094742e8ec41793 (diff)
parent9e082734b3a7c2685c1593dae8dca1e73568d51c (diff)
downloadgit-e39212ab08e8d37dda5d8fd32b54099fe01dbbdb.zip
git-e39212ab08e8d37dda5d8fd32b54099fe01dbbdb.tar.gz
git-e39212ab08e8d37dda5d8fd32b54099fe01dbbdb.tar.bz2
Merge branch 'nd/maint-fix-add-typo-detection'
* nd/maint-fix-add-typo-detection: Revert "excluded_1(): support exclude files in index" unpack-trees: fix sparse checkout's "unable to match directories" unpack-trees: move all skip-worktree checks back to unpack_trees() dir.c: add free_excludes() cache.h: realign and use (1 << x) form for CE_* constants
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/dir.c b/dir.c
index 38f3e3e..570b651 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)