t4209: set up expectations up front
[git/mingw.git] / t / t4209-log-pickaxe.sh
blobff668b587772791763145c16b2d0c41b9bde474e
1 #!/bin/sh
3 test_description='log --grep/--author/--regexp-ignore-case/-S/-G'
4 . ./test-lib.sh
6 test_expect_success setup '
7 >expect_nomatch &&
9 >file &&
10 git add file &&
11 test_tick &&
12 git commit -m initial &&
13 git rev-parse --verify HEAD >expect_initial &&
15 echo Picked >file &&
16 git add file &&
17 test_tick &&
18 git commit --author="Another Person <another@example.com>" -m second &&
19 git rev-parse --verify HEAD >expect_second
22 test_expect_success 'log --grep' '
23 git log --grep=initial --format=%H >actual &&
24 test_cmp expect_initial actual
27 test_expect_success 'log --grep --regexp-ignore-case' '
28 git log --regexp-ignore-case --grep=InItial --format=%H >actual &&
29 test_cmp expect_initial actual
32 test_expect_success 'log --grep -i' '
33 git log -i --grep=InItial --format=%H >actual &&
34 test_cmp expect_initial actual
37 test_expect_success 'log --author --regexp-ignore-case' '
38 git log --regexp-ignore-case --author=person --format=%H >actual &&
39 test_cmp expect_second actual
42 test_expect_success 'log --author -i' '
43 git log -i --author=person --format=%H >actual &&
44 test_cmp expect_second actual
47 test_expect_success 'log -G (nomatch)' '
48 git log -Gpicked --format=%H >actual &&
49 test_cmp expect_nomatch actual
52 test_expect_success 'log -G (match)' '
53 git log -GPicked --format=%H >actual &&
54 test_cmp expect_second actual
57 test_expect_success 'log -G --regexp-ignore-case (nomatch)' '
58 git log --regexp-ignore-case -Gpickle --format=%H >actual &&
59 test_cmp expect_nomatch actual
62 test_expect_success 'log -G -i (nomatch)' '
63 git log -i -Gpickle --format=%H >actual &&
64 test_cmp expect_nomatch actual
67 test_expect_success 'log -G --regexp-ignore-case (match)' '
68 git log --regexp-ignore-case -Gpicked --format=%H >actual &&
69 test_cmp expect_second actual
72 test_expect_success 'log -G -i (match)' '
73 git log -i -Gpicked --format=%H >actual &&
74 test_cmp expect_second actual
77 test_expect_success 'log -G --textconv (missing textconv tool)' '
78 echo "* diff=test" >.gitattributes &&
79 test_must_fail git -c diff.test.textconv=missing log -Gfoo &&
80 rm .gitattributes
83 test_expect_success 'log -G --no-textconv (missing textconv tool)' '
84 echo "* diff=test" >.gitattributes &&
85 git -c diff.test.textconv=missing log -Gfoo --no-textconv >actual &&
86 test_cmp expect_nomatch actual &&
87 rm .gitattributes
90 test_expect_success 'log -S (nomatch)' '
91 git log -Spicked --format=%H >actual &&
92 test_cmp expect_nomatch actual
95 test_expect_success 'log -S (match)' '
96 git log -SPicked --format=%H >actual &&
97 test_cmp expect_second actual
100 test_expect_success 'log -S --regexp-ignore-case (match)' '
101 git log --regexp-ignore-case -Spicked --format=%H >actual &&
102 test_cmp expect_second actual
105 test_expect_success 'log -S -i (match)' '
106 git log -i -Spicked --format=%H >actual &&
107 test_cmp expect_second actual
110 test_expect_success 'log -S --regexp-ignore-case (nomatch)' '
111 git log --regexp-ignore-case -Spickle --format=%H >actual &&
112 test_cmp expect_nomatch actual
115 test_expect_success 'log -S -i (nomatch)' '
116 git log -i -Spickle --format=%H >actual &&
117 test_cmp expect_nomatch actual
120 test_expect_success 'log -S --textconv (missing textconv tool)' '
121 echo "* diff=test" >.gitattributes &&
122 test_must_fail git -c diff.test.textconv=missing log -Sfoo &&
123 rm .gitattributes
126 test_expect_success 'log -S --no-textconv (missing textconv tool)' '
127 echo "* diff=test" >.gitattributes &&
128 git -c diff.test.textconv=missing log -Sfoo --no-textconv >actual &&
129 test_cmp expect_nomatch actual &&
130 rm .gitattributes
133 test_done