diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2013-12-06 11:30:48 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-12-07 01:00:39 +0400 |
commit | ef79b1f8704668a6cdf4278f9255e03ca785bfb4 (patch) | |
tree | f74ee3986aee50992cab9fcf16fcac3e55abe551 /builtin/add.c | |
parent | 8b7cb51a9dda0debf48c62ae79b9d60a23507097 (diff) |
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.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/add.c b/builtin/add.c index 226f758869..0df73ae735 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)) || |