diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2013-12-06 08:30:48 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-12-06 22:00:39 +0100 |
commit | ef79b1f8704668a6cdf4278f9255e03ca785bfb4 (patch) | |
tree | f74ee3986aee50992cab9fcf16fcac3e55abe551 /builtin | |
parent | glossary-content.txt: rephrase magic signature part (diff) | |
download | git-ef79b1f8704668a6cdf4278f9255e03ca785bfb4.tar.xz git-ef79b1f8704668a6cdf4278f9255e03ca785bfb4.zip |
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')
-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)) || |