summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-01-10 18:31:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-01-10 18:31:48 (GMT)
commit010d81ae35238c1b60144dce3fd3eba90a45b434 (patch)
tree4f8fa552d2dc9664256323045c1187b77308548a /builtin
parent932f7e47699993de0f6ad2af92be613994e40afe (diff)
parent1649612a227eaa5af7cb0e2d059728c0148485d9 (diff)
downloadgit-010d81ae35238c1b60144dce3fd3eba90a45b434.zip
git-010d81ae35238c1b60144dce3fd3eba90a45b434.tar.gz
git-010d81ae35238c1b60144dce3fd3eba90a45b434.tar.bz2
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 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)) ||