Skip to content

Commit

Permalink
Merge branch 'nd/dwim-wildcards-as-pathspecs'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gitster committed May 19, 2015
2 parents bcd1ecd + 28fcc0b commit 949d167
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion setup.c
Expand Up @@ -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;
Expand Down

0 comments on commit 949d167

Please sign in to comment.