Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
builtin/add.c: use path_excluded()
author
Junio C Hamano
<gitster@pobox.com>
Wed, 6 Jun 2012 04:44:22 +0000
(21:44 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 6 Jun 2012 04:44:22 +0000
(21:44 -0700)
This only happens in --ignore-missing --dry-run codepath which
presumably nobody should care, but is for completeness.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/add.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
782cd4c
)
diff --git
a/builtin/add.c
b/builtin/add.c
index c59b0c98fefefc413c8330715fffcc83142d5b2d..e5b40d98739a590e5b69ba9c793b901b14ee1ead 100644
(file)
--- a/
builtin/add.c
+++ b/
builtin/add.c
@@
-441,6
+441,9
@@
int cmd_add(int argc, const char **argv, const char *prefix)
if (pathspec) {
int i;
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++) {
if (!seen)
seen = find_used_pathspec(pathspec);
for (i = 0; pathspec[i]; i++) {
@@
-448,7
+451,7
@@
int cmd_add(int argc, const char **argv, const char *prefix)
&& !file_exists(pathspec[i])) {
if (ignore_missing) {
int dtype = DT_UNKNOWN;
&& !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"),
dir_add_ignored(&dir, pathspec[i], strlen(pathspec[i]));
} else
die(_("pathspec '%s' did not match any files"),
@@
-456,6
+459,7
@@
int cmd_add(int argc, const char **argv, const char *prefix)
}
}
free(seen);
}
}
free(seen);
+ path_exclude_check_clear(&check);
}
exit_status |= add_files_to_cache(prefix, pathspec, flags);
}
exit_status |= add_files_to_cache(prefix, pathspec, flags);