summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-02-24 13:25:52 -0800
committerJunio C Hamano <gitster@pobox.com>2016-02-24 13:25:52 -0800
commite6a6a768ca472afed90adbbd786e5c04fff6be7b (patch)
tree24e3f08992b8d7135cf703a013c591f41018757b /setup.c
parent7c0da37d7b0e09c199788191b322bf45fd003e3c (diff)
parentaac4fac1689f7d1414523d2ac96f1c737ee53b71 (diff)
downloadgit-e6a6a768ca472afed90adbbd786e5c04fff6be7b.tar.gz
Merge branch 'nd/dwim-wildcards-as-pathspecs'
"git show 'HEAD:Foo[BAR]Baz'" did not interpret the argument as a rev, i.e. the object named by the the pathname with wildcard characters in a tree object. * nd/dwim-wildcards-as-pathspecs: get_sha1: don't die() on bogus search strings check_filename: tighten dwim-wildcard ambiguity checkout: reorder check_filename conditional
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/setup.c b/setup.c
index 0deb02238b..59ec6587aa 100644
--- a/setup.c
+++ b/setup.c
@@ -139,9 +139,7 @@ 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 (!no_wildcard(arg))
- return 1;
- else if (prefix)
+ } else if (prefix)
name = prefix_filename(prefix, strlen(prefix), arg);
else
name = arg;
@@ -202,7 +200,7 @@ void verify_filename(const char *prefix,
{
if (*arg == '-')
die("bad flag '%s' used after filename", arg);
- if (check_filename(prefix, arg))
+ if (check_filename(prefix, arg) || !no_wildcard(arg))
return;
die_verify_filename(prefix, arg, diagnose_misspelt_rev);
}