From: Junio C Hamano Date: Sun, 6 Jan 2013 07:42:07 +0000 (-0800) Subject: Merge branch 'jk/pathspec-literal' X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=971e829cd84cf95203cec44d22d0e009f98ddbf5;p=git.git Merge branch 'jk/pathspec-literal' 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 --- 971e829cd84cf95203cec44d22d0e009f98ddbf5 diff --cc dir.c index 9afd38860,03ff36bc6..095ea7eba --- a/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,