From: Junio C Hamano Date: Wed, 24 Feb 2016 21:25:52 +0000 (-0800) Subject: Merge branch 'nd/dwim-wildcards-as-pathspecs' X-Git-Tag: v2.8.0-rc0~36 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/e6a6a768ca472afed90adbbd786e5c04fff6be7b?hp=--cc 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 --- e6a6a768ca472afed90adbbd786e5c04fff6be7b diff --cc sha1_name.c index 89918ca158,6a2195fcc1..d0f844db89 --- a/sha1_name.c +++ b/sha1_name.c @@@ -886,14 -857,9 +886,14 @@@ static int get_sha1_oneline(const char regex_t regex; if (prefix[0] == '!') { - if (prefix[1] != '!') - return -1; prefix++; + + if (prefix[0] == '-') { + prefix++; + negative = 1; + } else if (prefix[0] != '!') { - die ("Invalid search pattern: %s", prefix); ++ return -1; + } } if (regcomp(®ex, prefix, REG_EXTENDED))