2011-05-08 11:08:26 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
test_description='magic pathspec tests using git-log'
|
|
|
|
|
|
|
|
. ./test-lib.sh
|
|
|
|
|
|
|
|
test_expect_success 'setup' '
|
|
|
|
test_commit initial &&
|
|
|
|
test_tick &&
|
|
|
|
git commit --allow-empty -m empty &&
|
|
|
|
mkdir sub
|
|
|
|
'
|
|
|
|
|
2013-01-21 13:00:48 +00:00
|
|
|
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 &&
|
2011-05-08 11:08:26 +00:00
|
|
|
grep ambiguous error
|
|
|
|
'
|
|
|
|
|
2013-01-21 13:00:48 +00:00
|
|
|
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
|
|
|
|
'
|
|
|
|
|
2011-05-08 11:08:26 +00:00
|
|
|
test_expect_success '"git log :" should be ambiguous' '
|
|
|
|
test_must_fail git log : 2>error &&
|
|
|
|
grep ambiguous error
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'git log -- :' '
|
|
|
|
git log -- :
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'git log HEAD -- :/' '
|
|
|
|
cat >expected <<-EOF &&
|
|
|
|
24b24cf initial
|
|
|
|
EOF
|
|
|
|
(cd sub && git log --oneline HEAD -- :/ >../actual) &&
|
|
|
|
test_cmp expected actual
|
|
|
|
'
|
|
|
|
|
|
|
|
test_done
|