check_filename(): handle ":^" path magic
We special-case "git log :/foo" to work when "foo" exists in the working tree. But :^ (and its alias :!) do not get the same treatment, requiring the user to supply a disambiguating "--". Let's make them work without requiring the user to type the "--". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
d51c6ee0d4
commit
42471bcee4
4
setup.c
4
setup.c
@ -141,6 +141,10 @@ int check_filename(const char *prefix, const char *arg)
|
||||
if (!*arg) /* ":/" is root dir, always exists */
|
||||
return 1;
|
||||
prefix = NULL;
|
||||
} else if (skip_prefix(arg, ":!", &arg) ||
|
||||
skip_prefix(arg, ":^", &arg)) {
|
||||
if (!*arg) /* excluding everything is silly, but allowed */
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (prefix)
|
||||
|
Reference in New Issue
Block a user