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
@ -52,6 +52,19 @@ test_expect_success 'git log HEAD -- :/' '
|
||||
test_cmp expected actual
|
||||
'
|
||||
|
||||
test_expect_success '"git log :^sub" is not ambiguous' '
|
||||
git log :^sub
|
||||
'
|
||||
|
||||
test_expect_success '"git log :^does-not-exist" does not match anything' '
|
||||
test_must_fail git log :^does-not-exist
|
||||
'
|
||||
|
||||
test_expect_success '"git log :!" behaves the same as :^' '
|
||||
git log :!sub &&
|
||||
test_must_fail git log :!does-not-exist
|
||||
'
|
||||
|
||||
test_expect_success 'command line pathspec parsing for "git log"' '
|
||||
git reset --hard &&
|
||||
>a &&
|
||||
|
Reference in New Issue
Block a user