]> git.ipfire.org Git - thirdparty/git.git/blame - t/t4208-log-magic-pathspec.sh
t2024: Fix &&-chaining and a couple of typos
[thirdparty/git.git] / t / t4208-log-magic-pathspec.sh
CommitLineData
6fd09f53
NTND
1#!/bin/sh
2
3test_description='magic pathspec tests using git-log'
4
5. ./test-lib.sh
6
7test_expect_success 'setup' '
8 test_commit initial &&
9 test_tick &&
10 git commit --allow-empty -m empty &&
11 mkdir sub
12'
13
4db86e8b
NTND
14test_expect_success '"git log :/" should not be ambiguous' '
15 git log :/
16'
17
18test_expect_success '"git log :/a" should be ambiguous (applied both rev and worktree)' '
19 : >a &&
20 test_must_fail git log :/a 2>error &&
6fd09f53
NTND
21 grep ambiguous error
22'
23
4db86e8b
NTND
24test_expect_success '"git log :/a -- " should not be ambiguous' '
25 git log :/a --
26'
27
28test_expect_success '"git log -- :/a" should not be ambiguous' '
29 git log -- :/a
30'
31
6fd09f53
NTND
32test_expect_success '"git log :" should be ambiguous' '
33 test_must_fail git log : 2>error &&
34 grep ambiguous error
35'
36
37test_expect_success 'git log -- :' '
38 git log -- :
39'
40
41test_expect_success 'git log HEAD -- :/' '
42 cat >expected <<-EOF &&
43 24b24cf initial
44 EOF
45 (cd sub && git log --oneline HEAD -- :/ >../actual) &&
46 test_cmp expected actual
47'
48
49test_done