dir.c: replace is_path_excluded with now equivalent is_excluded API
[gitweb.git] / unpack-trees.c
index 0e1a196ace33110e2bb74cde90d6f62358413ead..ede4299b833378ef5a4d44dac181d54889343a27 100644 (file)
@@ -1020,16 +1020,12 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
        if (!core_apply_sparse_checkout || !o->update)
                o->skip_sparse_checkout = 1;
        if (!o->skip_sparse_checkout) {
-               if (add_excludes_from_file_to_list(git_path("info/sparse-checkout"), "", 0, NULL, &el, 0) < 0)
+               if (add_excludes_from_file_to_list(git_path("info/sparse-checkout"), "", 0, &el, 0) < 0)
                        o->skip_sparse_checkout = 1;
                else
                        o->el = &el;
        }
 
-       if (o->dir) {
-               o->path_exclude_check = xmalloc(sizeof(struct path_exclude_check));
-               path_exclude_check_init(o->path_exclude_check, o->dir);
-       }
        memset(&o->result, 0, sizeof(o->result));
        o->result.initialized = 1;
        o->result.timestamp.sec = o->src_index->timestamp.sec;
@@ -1155,10 +1151,6 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
 
 done:
        clear_exclude_list(&el);
-       if (o->path_exclude_check) {
-               path_exclude_check_clear(o->path_exclude_check);
-               free(o->path_exclude_check);
-       }
        return ret;
 
 return_failed:
@@ -1375,7 +1367,7 @@ static int check_ok_to_remove(const char *name, int len, int dtype,
                return 0;
 
        if (o->dir &&
-           is_path_excluded(o->path_exclude_check, name, -1, &dtype))
+           is_excluded(o->dir, name, &dtype))
                /*
                 * ce->name is explicitly excluded, so it is Ok to
                 * overwrite it.