]> git.scripts.mit.edu Git - git.git/blobdiff - pathspec.c
interpret_branch_name: always respect "namelen" parameter
[git.git] / pathspec.c
index be962d47aa116788f883b5a450e2b87d94151f21..87b3b82f1fd9baee7758159e5e3119b6da0655e3 100644 (file)
@@ -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,