Merge branch 'nd/i18n-branch-lego'
[gitweb.git] / builtin / add.c
index b79336d712b4c71cc2f026b0e9f42ea0bcebfc6f..87446cf92a686ed69717c85a6b38302f59351460 100644 (file)
@@ -443,6 +443,9 @@ 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_used_pathspec(pathspec);
                for (i = 0; pathspec[i]; i++) {
@@ -450,7 +453,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
                            && !file_exists(pathspec[i])) {
                                if (ignore_missing) {
                                        int dtype = DT_UNKNOWN;
-                                       if (excluded(&dir, pathspec[i], &dtype))
+                                       if (path_excluded(&check, pathspec[i], -1, &dtype))
                                                dir_add_ignored(&dir, pathspec[i], strlen(pathspec[i]));
                                } else
                                        die(_("pathspec '%s' did not match any files"),
@@ -458,6 +461,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
                        }
                }
                free(seen);
+               path_exclude_check_clear(&check);
        }
 
        plug_bulk_checkin();