Skip to content

Commit 949d167

Browse files
committed
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
2 parents bcd1ecd + 28fcc0b commit 949d167

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

setup.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ int check_filename(const char *prefix, const char *arg)
140140
if (arg[2] == '\0') /* ":/" is root dir, always exists */
141141
return 1;
142142
name = arg + 2;
143-
} else if (prefix)
143+
} else if (!no_wildcard(arg))
144+
return 1;
145+
else if (prefix)
144146
name = prefix_filename(prefix, strlen(prefix), arg);
145147
else
146148
name = arg;

0 commit comments

Comments
 (0)