pathspec: pass directory indicator to match_pathspec_item()
[git/mingw.git] / t / t4209-log-pickaxe.sh
blob38fb80f643534a2bd724e13ef271f90167ac11a3
1 #!/bin/sh
3 test_description='log --grep/--author/--regexp-ignore-case/-S/-G'
4 . ./test-lib.sh
6 test_expect_success setup '
7 >file &&
8 git add file &&
9 test_tick &&
10 git commit -m initial &&
12 echo Picked >file &&
13 test_tick &&
14 git commit -a --author="Another Person <another@example.com>" -m second
17 test_expect_success 'log --grep' '
18 git log --grep=initial --format=%H >actual &&
19 git rev-parse --verify HEAD^ >expect &&
20 test_cmp expect actual
23 test_expect_success 'log --grep --regexp-ignore-case' '
24 git log --regexp-ignore-case --grep=InItial --format=%H >actual &&
25 git rev-parse --verify HEAD^ >expect &&
26 test_cmp expect actual
29 test_expect_success 'log --grep -i' '
30 git log -i --grep=InItial --format=%H >actual &&
31 git rev-parse --verify HEAD^ >expect &&
32 test_cmp expect actual
35 test_expect_success 'log --author --regexp-ignore-case' '
36 git log --regexp-ignore-case --author=person --format=%H >actual &&
37 git rev-parse --verify HEAD >expect &&
38 test_cmp expect actual
41 test_expect_success 'log --author -i' '
42 git log -i --author=person --format=%H >actual &&
43 git rev-parse --verify HEAD >expect &&
44 test_cmp expect actual
47 test_expect_success 'log -G (nomatch)' '
48 git log -Gpicked --format=%H >actual &&
49 >expect &&
50 test_cmp expect actual
53 test_expect_success 'log -G (match)' '
54 git log -GPicked --format=%H >actual &&
55 git rev-parse --verify HEAD >expect &&
56 test_cmp expect actual
59 test_expect_success 'log -G --regexp-ignore-case (nomatch)' '
60 git log --regexp-ignore-case -Gpickle --format=%H >actual &&
61 >expect &&
62 test_cmp expect actual
65 test_expect_success 'log -G -i (nomatch)' '
66 git log -i -Gpickle --format=%H >actual &&
67 >expect &&
68 test_cmp expect actual
71 test_expect_success 'log -G --regexp-ignore-case (match)' '
72 git log --regexp-ignore-case -Gpicked --format=%H >actual &&
73 git rev-parse --verify HEAD >expect &&
74 test_cmp expect actual
77 test_expect_success 'log -G -i (match)' '
78 git log -i -Gpicked --format=%H >actual &&
79 git rev-parse --verify HEAD >expect &&
80 test_cmp expect actual
83 test_expect_success 'log -G --textconv (missing textconv tool)' '
84 echo "* diff=test" >.gitattributes &&
85 test_must_fail git -c diff.test.textconv=missing log -Gfoo &&
86 rm .gitattributes
89 test_expect_success 'log -G --no-textconv (missing textconv tool)' '
90 echo "* diff=test" >.gitattributes &&
91 git -c diff.test.textconv=missing log -Gfoo --no-textconv >actual &&
92 >expect &&
93 test_cmp expect actual &&
94 rm .gitattributes
97 test_expect_success 'log -S (nomatch)' '
98 git log -Spicked --format=%H >actual &&
99 >expect &&
100 test_cmp expect actual
103 test_expect_success 'log -S (match)' '
104 git log -SPicked --format=%H >actual &&
105 git rev-parse --verify HEAD >expect &&
106 test_cmp expect actual
109 test_expect_success 'log -S --regexp-ignore-case (match)' '
110 git log --regexp-ignore-case -Spicked --format=%H >actual &&
111 git rev-parse --verify HEAD >expect &&
112 test_cmp expect actual
115 test_expect_success 'log -S -i (match)' '
116 git log -i -Spicked --format=%H >actual &&
117 git rev-parse --verify HEAD >expect &&
118 test_cmp expect actual
121 test_expect_success 'log -S --regexp-ignore-case (nomatch)' '
122 git log --regexp-ignore-case -Spickle --format=%H >actual &&
123 >expect &&
124 test_cmp expect actual
127 test_expect_success 'log -S -i (nomatch)' '
128 git log -i -Spickle --format=%H >actual &&
129 >expect &&
130 test_cmp expect actual
133 test_expect_success 'log -S --textconv (missing textconv tool)' '
134 echo "* diff=test" >.gitattributes &&
135 test_must_fail git -c diff.test.textconv=missing log -Sfoo &&
136 rm .gitattributes
139 test_expect_success 'log -S --no-textconv (missing textconv tool)' '
140 echo "* diff=test" >.gitattributes &&
141 git -c diff.test.textconv=missing log -Sfoo --no-textconv >actual &&
142 >expect &&
143 test_cmp expect actual &&
144 rm .gitattributes
147 test_done