rebase: use 'git stash store' to simplify logic
[gitweb.git] / builtin / check-ignore.c
index 709535ce09fd3876e48e6e7b81bc2f6654e04c1e..854a88a0568e2f0226d26a2d9ebc99d24765053b 100644 (file)
@@ -59,7 +59,6 @@ static int check_ignore(const char *prefix, const char **pathspec)
        const char *path, *full_path;
        char *seen;
        int num_ignored = 0, dtype = DT_UNKNOWN, i;
-       struct path_exclude_check check;
        struct exclude *exclude;
 
        /* read_cache() is only necessary so we can watch out for submodules. */
@@ -67,7 +66,6 @@ static int check_ignore(const char *prefix, const char **pathspec)
                die(_("index file corrupt"));
 
        memset(&dir, 0, sizeof(dir));
-       dir.flags |= DIR_COLLECT_IGNORED;
        setup_standard_excludes(&dir);
 
        if (!pathspec || !*pathspec) {
@@ -76,7 +74,6 @@ static int check_ignore(const char *prefix, const char **pathspec)
                return 0;
        }
 
-       path_exclude_check_init(&check, &dir);
        /*
         * look for pathspecs matching entries in the index, since these
         * should not be ignored, in order to be consistent with
@@ -89,9 +86,8 @@ static int check_ignore(const char *prefix, const char **pathspec)
                                        ? strlen(prefix) : 0, path);
                full_path = check_path_for_gitlink(full_path);
                die_if_path_beyond_symlink(full_path, prefix);
-               if (!seen[i] && path[0]) {
-                       exclude = last_exclude_matching_path(&check, full_path,
-                                                            -1, &dtype);
+               if (!seen[i]) {
+                       exclude = last_exclude_matching(&dir, full_path, &dtype);
                        if (exclude) {
                                if (!quiet)
                                        output_exclude(path, exclude);
@@ -101,7 +97,6 @@ static int check_ignore(const char *prefix, const char **pathspec)
        }
        free(seen);
        clear_directory(&dir);
-       path_exclude_check_clear(&check);
 
        return num_ignored;
 }