summaryrefslogtreecommitdiff
path: root/pathspec.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-11-18 14:31:29 -0800
committerJunio C Hamano <gitster@pobox.com>2013-11-18 14:31:29 -0800
commitc6f1b920ac8b41b9175910d5866924a12a0ce6b9 (patch)
treeddc33851da0035b36eb67c1dbe6b83b28342420c /pathspec.c
parent33da0c9c3c2ec2706c80f70226739f14a66baa21 (diff)
parent4a2d5ae262a6d372d0951da9cee3c7ad2a8dbca6 (diff)
downloadgit-c6f1b920ac8b41b9175910d5866924a12a0ce6b9.tar.gz
Merge branch 'nd/literal-pathspecs'
Fixes a regression on 'master' since v1.8.4. * nd/literal-pathspecs: pathspec: stop --*-pathspecs impact on internal parse_pathspec() uses
Diffstat (limited to 'pathspec.c')
-rw-r--r--pathspec.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/pathspec.c b/pathspec.c
index ad1a9f5b28..4cf2bd365a 100644
--- a/pathspec.c
+++ b/pathspec.c
@@ -128,7 +128,11 @@ static unsigned prefix_pathspec(struct pathspec_item *item,
die(_("global 'literal' pathspec setting is incompatible "
"with all other global pathspec settings"));
- if (elt[0] != ':' || literal_global) {
+ if (flags & PATHSPEC_LITERAL_PATH)
+ global_magic = 0;
+
+ if (elt[0] != ':' || literal_global ||
+ (flags & PATHSPEC_LITERAL_PATH)) {
; /* nothing to do */
} else if (elt[1] == '(') {
/* longhand */
@@ -405,6 +409,9 @@ void parse_pathspec(struct pathspec *pathspec,
item[i].magic = prefix_pathspec(item + i, &short_magic,
argv + i, flags,
prefix, prefixlen, entry);
+ if ((flags & PATHSPEC_LITERAL_PATH) &&
+ !(magic_mask & PATHSPEC_LITERAL))
+ item[i].magic |= PATHSPEC_LITERAL;
if (item[i].magic & magic_mask)
unsupported_magic(entry,
item[i].magic & magic_mask,