summaryrefslogtreecommitdiff
path: root/builtin/add.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/add.c')
-rw-r--r--builtin/add.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/builtin/add.c b/builtin/add.c
index b79336d..87446cf 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -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();