diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-01-30 08:52:53 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-01-30 08:52:53 -0800 |
commit | 7b5196909c7773a3ce6d3cd0ba78f42249bf27c3 (patch) | |
tree | 643b5ad7f520dd456d35ab0e7e86c69da665ce7c /t | |
parent | Merge branch 'maint' (diff) | |
parent | grep: avoid accepting ambiguous revision (diff) | |
download | tgif-7b5196909c7773a3ce6d3cd0ba78f42249bf27c3.tar.xz |
Merge branch 'nd/magic-pathspec-from-root'
When giving arguments without "--" disambiguation, object names
that come earlier on the command line must not be interpretable as
pathspecs and pathspecs that come later on the command line must
not be interpretable as object names. Tweak the disambiguation
rule so that ":/" (no other string before or after) is always
interpreted as a pathspec, to avoid having to say "git cmd -- :/".
* nd/magic-pathspec-from-root:
grep: avoid accepting ambiguous revision
Update :/abc ambiguity check
Diffstat (limited to 't')
-rwxr-xr-x | t/t4208-log-magic-pathspec.sh | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/t/t4208-log-magic-pathspec.sh b/t/t4208-log-magic-pathspec.sh index 2c482b622b..72300b5f24 100755 --- a/t/t4208-log-magic-pathspec.sh +++ b/t/t4208-log-magic-pathspec.sh @@ -11,11 +11,24 @@ test_expect_success 'setup' ' mkdir sub ' -test_expect_success '"git log :/" should be ambiguous' ' - test_must_fail git log :/ 2>error && +test_expect_success '"git log :/" should not be ambiguous' ' + git log :/ +' + +test_expect_success '"git log :/a" should be ambiguous (applied both rev and worktree)' ' + : >a && + test_must_fail git log :/a 2>error && grep ambiguous error ' +test_expect_success '"git log :/a -- " should not be ambiguous' ' + git log :/a -- +' + +test_expect_success '"git log -- :/a" should not be ambiguous' ' + git log -- :/a +' + test_expect_success '"git log :" should be ambiguous' ' test_must_fail git log : 2>error && grep ambiguous error |