summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2014-01-10 10:31:48 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-01-10 10:31:48 -0800
commit010d81ae35238c1b60144dce3fd3eba90a45b434 (patch)
tree4f8fa552d2dc9664256323045c1187b77308548a /builtin
parentMerge branch 'maint' (diff)
parentpathspec.c: support adding prefix magic to a pathspec with mnemonic magic (diff)
downloadtgif-010d81ae35238c1b60144dce3fd3eba90a45b434.tar.xz
Merge branch 'nd/negative-pathspec'
Introduce "negative pathspec" magic, to allow "git log -- . ':!dir'" to tell us "I am interested in everything but 'dir' directory". * nd/negative-pathspec: pathspec.c: support adding prefix magic to a pathspec with mnemonic magic Support pathspec magic :(exclude) and its short form :! glossary-content.txt: rephrase magic signature part
Diffstat (limited to 'builtin')
-rw-r--r--builtin/add.c5
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)) ||