summaryrefslogtreecommitdiff
path: root/pathspec.c
diff options
context:
space:
mode:
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,