summaryrefslogtreecommitdiff
path: root/builtin/add.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-12-06 07:30:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-12-06 21:00:39 (GMT)
commitef79b1f8704668a6cdf4278f9255e03ca785bfb4 (patch)
treef74ee3986aee50992cab9fcf16fcac3e55abe551 /builtin/add.c
parent8b7cb51a9dda0debf48c62ae79b9d60a23507097 (diff)
downloadgit-ef79b1f8704668a6cdf4278f9255e03ca785bfb4.zip
git-ef79b1f8704668a6cdf4278f9255e03ca785bfb4.tar.gz
git-ef79b1f8704668a6cdf4278f9255e03ca785bfb4.tar.bz2
Support pathspec magic :(exclude) and its short form :!
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/add.c')
-rw-r--r--builtin/add.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/add.c b/builtin/add.c
index 226f758..0df73ae 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -540,10 +540,13 @@ int cmd_add(int argc, const char **argv, const char *prefix)
PATHSPEC_FROMTOP |
PATHSPEC_LITERAL |
PATHSPEC_GLOB |
- PATHSPEC_ICASE);
+ PATHSPEC_ICASE |
+ PATHSPEC_EXCLUDE);
for (i = 0; i < pathspec.nr; i++) {
const char *path = pathspec.items[i].match;
+ if (pathspec.items[i].magic & PATHSPEC_EXCLUDE)
+ continue;
if (!seen[i] &&
((pathspec.items[i].magic &
(PATHSPEC_GLOB | PATHSPEC_ICASE)) ||