@matheusbsbs / matheus-bagliano / commits / 0564b3ee7c
Fork 0

t4019 (diff-wserror): add lots of missing &&

Also add test_might_fail in front of the git_config --unset commands that may be trying to unset a value that never got set (due to a previous failing test) or that were already unset. Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Oct 3, 2010 at 14:00 UTC 0564b3ee7c1bfe0eb2a994d89e37def6d0e8ef78
1 file changed +27 -26
t/t4019-diff-wserror.sh
+27 -26
@@ -36,11 +36,12 @@ prepare_output () {
36 git diff --color >output
37 $grep_a "$blue_grep" output >error
38 $grep_a -v "$blue_grep" output >normal
39 + return 0
40 }
41
42 test_expect_success default '
43
43 - prepare_output
44 + prepare_output &&
45
46 grep Eight normal >/dev/null &&
47 grep HT error >/dev/null &&
@@ -52,8 +53,8 @@ test_expect_success default '
53
54 test_expect_success 'without -trail' '
55
55 - git config core.whitespace -trail
56 - prepare_output
56 + git config core.whitespace -trail &&
57 + prepare_output &&
58
59 grep Eight normal >/dev/null &&
60 grep HT error >/dev/null &&
@@ -65,9 +66,9 @@ test_expect_success 'without -trail' '
66
67 test_expect_success 'without -trail (attribute)' '
68
68 - git config --unset core.whitespace
69 - echo "F whitespace=-trail" >.gitattributes
70 - prepare_output
69 + test_might_fail git config --unset core.whitespace &&
70 + echo "F whitespace=-trail" >.gitattributes &&
71 + prepare_output &&
72
73 grep Eight normal >/dev/null &&
74 grep HT error >/dev/null &&
@@ -79,9 +80,9 @@ test_expect_success 'without -trail (attribute)' '
80
81 test_expect_success 'without -space' '
82
82 - rm -f .gitattributes
83 - git config core.whitespace -space
84 - prepare_output
83 + rm -f .gitattributes &&
84 + git config core.whitespace -space &&
85 + prepare_output &&
86
87 grep Eight normal >/dev/null &&
88 grep HT normal >/dev/null &&
@@ -93,9 +94,9 @@ test_expect_success 'without -space' '
94
95 test_expect_success 'without -space (attribute)' '
96
96 - git config --unset core.whitespace
97 - echo "F whitespace=-space" >.gitattributes
98 - prepare_output
97 + test_might_fail git config --unset core.whitespace &&
98 + echo "F whitespace=-space" >.gitattributes &&
99 + prepare_output &&
100
101 grep Eight normal >/dev/null &&
102 grep HT normal >/dev/null &&
@@ -107,9 +108,9 @@ test_expect_success 'without -space (attribute)' '
108
109 test_expect_success 'with indent-non-tab only' '
110
110 - rm -f .gitattributes
111 - git config core.whitespace indent,-trailing,-space
112 - prepare_output
111 + rm -f .gitattributes &&
112 + git config core.whitespace indent,-trailing,-space &&
113 + prepare_output &&
114
115 grep Eight error >/dev/null &&
116 grep HT normal >/dev/null &&
@@ -121,9 +122,9 @@ test_expect_success 'with indent-non-tab only' '
122
123 test_expect_success 'with indent-non-tab only (attribute)' '
124
124 - git config --unset core.whitespace
125 - echo "F whitespace=indent,-trailing,-space" >.gitattributes
126 - prepare_output
125 + test_might_fail git config --unset core.whitespace &&
126 + echo "F whitespace=indent,-trailing,-space" >.gitattributes &&
127 + prepare_output &&
128
129 grep Eight error >/dev/null &&
130 grep HT normal >/dev/null &&
@@ -135,9 +136,9 @@ test_expect_success 'with indent-non-tab only (attribute)' '
136
137 test_expect_success 'with cr-at-eol' '
138
138 - rm -f .gitattributes
139 - git config core.whitespace cr-at-eol
140 - prepare_output
139 + rm -f .gitattributes &&
140 + git config core.whitespace cr-at-eol &&
141 + prepare_output &&
142
143 grep Eight normal >/dev/null &&
144 grep HT error >/dev/null &&
@@ -149,9 +150,9 @@ test_expect_success 'with cr-at-eol' '
150
151 test_expect_success 'with cr-at-eol (attribute)' '
152
152 - git config --unset core.whitespace
153 - echo "F whitespace=trailing,cr-at-eol" >.gitattributes
154 - prepare_output
153 + test_might_fail git config --unset core.whitespace &&
154 + echo "F whitespace=trailing,cr-at-eol" >.gitattributes &&
155 + prepare_output &&
156
157 grep Eight normal >/dev/null &&
158 grep HT error >/dev/null &&
@@ -179,11 +180,11 @@ test_expect_success 'trailing empty lines (2)' '
180 '
181
182 test_expect_success 'do not color trailing cr in context' '
182 - git config --unset core.whitespace
183 + test_might_fail git config --unset core.whitespace &&
184 rm -f .gitattributes &&
185 echo AAAQ | tr Q "\015" >G &&
186 git add G &&
186 - echo BBBQ | tr Q "\015" >>G
187 + echo BBBQ | tr Q "\015" >>G &&
188 git diff --color G | tr "\015" Q >output &&
189 grep "BBB.*${blue_grep}Q" output &&
190 grep "AAA.*\[mQ" output