diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-05-19 13:17:57 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-05-19 13:17:58 -0700 |
commit | 949d16795c55ae4712aaec847d55bd2d7d050c84 (patch) | |
tree | 147192912e9f4fa4f0bef595d6d56c10552f2ab3 /setup.c | |
parent | bcd1ecd08a644a19adfebb31a72a4e608e077c6d (diff) | |
parent | 28fcc0b71a6543fe50576efc1ac8fb4e4555b6a6 (diff) | |
download | git-949d16795c55ae4712aaec847d55bd2d7d050c84.tar.gz |
Merge branch 'nd/dwim-wildcards-as-pathspecs'
A heuristic to help the "git <cmd> <revs> <pathspec>" command line
convention to catch mistyped paths is to make sure all the non-rev
parameters in the later part of the command line are names of the
files in the working tree, but that means "git grep $str -- \*.c"
must always be disambiguated with "--", because nobody sane will
create a file whose name literally is asterisk-dot-see. Loosen the
heuristic to declare that with a wildcard string the user likely
meant to give us a pathspec.
* nd/dwim-wildcards-as-pathspecs:
pathspec: avoid the need of "--" when wildcard is used
Diffstat (limited to 'setup.c')
-rw-r--r-- | setup.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -140,7 +140,9 @@ int check_filename(const char *prefix, const char *arg) if (arg[2] == '\0') /* ":/" is root dir, always exists */ return 1; name = arg + 2; - } else if (prefix) + } else if (!no_wildcard(arg)) + return 1; + else if (prefix) name = prefix_filename(prefix, strlen(prefix), arg); else name = arg; |