Merge branch 'jk/pathspec-literal'
authorJunio C Hamano <gitster@pobox.com>
Sun, 6 Jan 2013 07:42:07 +0000 (23:42 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sun, 6 Jan 2013 07:42:07 +0000 (23:42 -0800)
Allow scripts to feed literal paths to commands that take
pathspecs, by disabling wildcard globbing.

* jk/pathspec-literal:
  add global --literal-pathspecs option

Conflicts:
dir.c

1  2 
Documentation/git.txt
cache.h
dir.c

Simple merge
diff --cc cache.h
Simple merge
diff --cc dir.c
index 9afd388604c05b5c7f7c34cd19f1e6ff2a14fdce,03ff36bc6eb24d716fc3fa49ff745575fa79683b..095ea7ebabfa25f1ff1aba199c09daaac984dbaa
--- 1/dir.c
--- 2/dir.c
+++ b/dir.c
@@@ -1454,14 -1433,10 +1458,18 @@@ int init_pathspec(struct pathspec *path
  
                item->match = path;
                item->len = strlen(path);
-               item->nowildcard_len = simple_length(path);
 -              item->use_wildcard = !limit_pathspec_to_literal() &&
 -                                   !no_wildcard(path);
 -              if (item->use_wildcard)
 -                      pathspec->has_wildcard = 1;
 +              item->flags = 0;
-               if (item->nowildcard_len < item->len) {
-                       pathspec->has_wildcard = 1;
-                       if (path[item->nowildcard_len] == '*' &&
-                           no_wildcard(path + item->nowildcard_len + 1))
-                               item->flags |= PATHSPEC_ONESTAR;
++              if (limit_pathspec_to_literal()) {
++                      item->nowildcard_len = item->len;
++              } else {
++                      item->nowildcard_len = simple_length(path);
++                      if (item->nowildcard_len < item->len) {
++                              pathspec->has_wildcard = 1;
++                              if (path[item->nowildcard_len] == '*' &&
++                                  no_wildcard(path + item->nowildcard_len + 1))
++                                      item->flags |= PATHSPEC_ONESTAR;
++                      }
 +              }
        }
  
        qsort(pathspec->items, pathspec->nr,