Merge branch 'kb/status-ignored-optim-2'
[gitweb.git] / builtin / add.c
index 54cd2d417d30408c8a4b13099efc6eee6a3d1e31..d4b40f2b7a9dbdabcb0133d84b29d8ab281d1baf 100644 (file)
@@ -545,9 +545,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 
        if (pathspec) {
                int i;
-               struct path_exclude_check check;
 
-               path_exclude_check_init(&check, &dir);
                if (!seen)
                        seen = find_pathspecs_matching_against_index(pathspec);
                for (i = 0; pathspec[i]; i++) {
@@ -555,7 +553,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
                            && !file_exists(pathspec[i])) {
                                if (ignore_missing) {
                                        int dtype = DT_UNKNOWN;
-                                       if (is_path_excluded(&check, pathspec[i], -1, &dtype))
+                                       if (is_excluded(&dir, pathspec[i], &dtype))
                                                dir_add_ignored(&dir, pathspec[i], strlen(pathspec[i]));
                                } else
                                        die(_("pathspec '%s' did not match any files"),
@@ -563,7 +561,6 @@ int cmd_add(int argc, const char **argv, const char *prefix)
                        }
                }
                free(seen);
-               path_exclude_check_clear(&check);
        }
 
        plug_bulk_checkin();