diff options
author | Jeff King <peff@peff.net> | 2017-05-26 21:08:39 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-05-29 04:36:56 +0200 |
commit | 42471bcee44e87669eb17f9fa13c8041a0fc35a1 (patch) | |
tree | 3196bc85d53e27c7c66fea8f5ab85db54fcfdd1f /t/t4208-log-magic-pathspec.sh | |
parent | check_filename(): use skip_prefix (diff) | |
download | git-42471bcee44e87669eb17f9fa13c8041a0fc35a1.tar.xz git-42471bcee44e87669eb17f9fa13c8041a0fc35a1.zip |
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>
Diffstat (limited to 't/t4208-log-magic-pathspec.sh')
-rwxr-xr-x | t/t4208-log-magic-pathspec.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t4208-log-magic-pathspec.sh b/t/t4208-log-magic-pathspec.sh index 70bc64100b..627890d7d8 100755 --- a/t/t4208-log-magic-pathspec.sh +++ b/t/t4208-log-magic-pathspec.sh @@ -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 && |