t: fix moderate &&-chain breakage

These are tests which are missing a link in their &&-chain, but in a way that probably does not effect the outcome of the test. Most of these are of the form: some_cmd >actual test_cmp expect actual The main point of the test is to verify the output, and a failure in some_cmd would probably be noticed by bogus output. But it is good for the tests to also confirm that "some_cmd" does not die unexpectedly after producing its output. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Mar 20, 2015 at 06:06 UTC 60687de5ba3eb90f8332fb1bcec73a2cb782c95c
13 files changed +44 -44
t/t0062-revision-walking.sh
+1 -1
@@ -26,7 +26,7 @@ test_expect_success 'setup' '
26 '
27
28 test_expect_success 'revision walking can be done twice' '
29 - test-revision-walking run-twice > run_twice_actual
29 + test-revision-walking run-twice >run_twice_actual &&
30 test_cmp run_twice_expected run_twice_actual
31 '
32
t/t0201-gettext-fallbacks.sh
+2 -2
@@ -52,7 +52,7 @@ test_expect_success 'eval_gettext: our eval_gettext() fallback can interpolate v
52 cmdline="git am" &&
53 export cmdline;
54 printf "When you have resolved this problem, run git am --resolved." >expect &&
55 - eval_gettext "When you have resolved this problem, run \$cmdline --resolved." >actual
55 + eval_gettext "When you have resolved this problem, run \$cmdline --resolved." >actual &&
56 test_i18ncmp expect actual
57 '
58
@@ -60,7 +60,7 @@ test_expect_success 'eval_gettext: our eval_gettext() fallback can interpolate v
60 cmdline="git am" &&
61 export cmdline;
62 printf "When you have resolved this problem, run \"git am --resolved\"." >expect &&
63 - eval_gettext "When you have resolved this problem, run \"\$cmdline --resolved\"." >actual
63 + eval_gettext "When you have resolved this problem, run \"\$cmdline --resolved\"." >actual &&
64 test_i18ncmp expect actual
65 '
66
t/t1300-repo-config.sh
+1 -1
@@ -1165,7 +1165,7 @@ test_expect_failure 'adding a key into an empty section reuses header' '
1165 Qkey = value
1166 EOF
1167
1168 - git config section.key value
1168 + git config section.key value &&
1169 test_cmp expect .git/config
1170 '
1171
t/t3001-ls-files-others-exclude.sh
+1 -1
@@ -294,7 +294,7 @@ one/a.1
294 one/two/a.1
295 three/a.1
296 EOF
297 - git ls-files -o -i --exclude "**/a.1" >actual
297 + git ls-files -o -i --exclude "**/a.1" >actual &&
298 test_cmp expect actual
299 '
300
t/t3010-ls-files-killed-modified.sh
+2 -2
@@ -99,12 +99,12 @@ test_expect_success 'git ls-files -k to show killed files.' '
99 '
100
101 test_expect_success 'git ls-files -k output (w/o icase)' '
102 - git ls-files -k >.output
102 + git ls-files -k >.output &&
103 test_cmp .expected .output
104 '
105
106 test_expect_success 'git ls-files -k output (w/ icase)' '
107 - git -c core.ignorecase=true ls-files -k >.output
107 + git -c core.ignorecase=true ls-files -k >.output &&
108 test_cmp .expected .output
109 '
110
t/t3404-rebase-interactive.sh
+1 -1
@@ -950,7 +950,7 @@ test_expect_success 'rebase --edit-todo can be used to modify todo' '
950 set_fake_editor &&
951 FAKE_LINES="edit 1 2 3" git rebase -i HEAD~3 &&
952 FAKE_LINES="2 1" git rebase --edit-todo &&
953 - git rebase --continue
953 + git rebase --continue &&
954 test M = $(git cat-file commit HEAD^ | sed -ne \$p) &&
955 test L = $(git cat-file commit HEAD | sed -ne \$p)
956 '
t/t4041-diff-submodule-option.sh
+1 -1
@@ -539,7 +539,7 @@ test_expect_success 'diff --submodule with objects referenced by alternates' '
539 git checkout origin/master
540 ) &&
541 git diff --submodule > ../actual
542 - )
542 + ) &&
543 test_cmp expected actual
544 '
545
t/t4052-stat-output.sh
+17 -17
@@ -94,7 +94,7 @@ EOF
94 while read verb expect cmd args
95 do
96 test_expect_success "$cmd $verb COLUMNS (big change)" '
97 - COLUMNS=200 git $cmd $args >output
97 + COLUMNS=200 git $cmd $args >output &&
98 grep " | " output >actual &&
99 test_cmp "$expect" actual
100 '
@@ -102,7 +102,7 @@ do
102 test "$cmd" != diff || continue
103
104 test_expect_success "$cmd --graph $verb COLUMNS (big change)" '
105 - COLUMNS=200 git $cmd $args --graph >output
105 + COLUMNS=200 git $cmd $args --graph >output &&
106 grep " | " output >actual &&
107 test_cmp "$expect-graph" actual
108 '
@@ -122,7 +122,7 @@ EOF
122 while read verb expect cmd args
123 do
124 test_expect_success "$cmd $verb not enough COLUMNS (big change)" '
125 - COLUMNS=40 git $cmd $args >output
125 + COLUMNS=40 git $cmd $args >output &&
126 grep " | " output >actual &&
127 test_cmp "$expect" actual
128 '
@@ -130,7 +130,7 @@ do
130 test "$cmd" != diff || continue
131
132 test_expect_success "$cmd --graph $verb not enough COLUMNS (big change)" '
133 - COLUMNS=40 git $cmd $args --graph >output
133 + COLUMNS=40 git $cmd $args --graph >output &&
134 grep " | " output >actual &&
135 test_cmp "$expect-graph" actual
136 '
@@ -150,7 +150,7 @@ EOF
150 while read verb expect cmd args
151 do
152 test_expect_success "$cmd $verb statGraphWidth config" '
153 - git -c diff.statGraphWidth=26 $cmd $args >output
153 + git -c diff.statGraphWidth=26 $cmd $args >output &&
154 grep " | " output >actual &&
155 test_cmp "$expect" actual
156 '
@@ -158,7 +158,7 @@ do
158 test "$cmd" != diff || continue
159
160 test_expect_success "$cmd --graph $verb statGraphWidth config" '
161 - git -c diff.statGraphWidth=26 $cmd $args --graph >output
161 + git -c diff.statGraphWidth=26 $cmd $args --graph >output &&
162 grep " | " output >actual &&
163 test_cmp "$expect-graph" actual
164 '
@@ -179,19 +179,19 @@ EOF
179 while read cmd args
180 do
181 test_expect_success "$cmd --stat=width with big change" '
182 - git $cmd $args --stat=40 >output
182 + git $cmd $args --stat=40 >output &&
183 grep " | " output >actual &&
184 test_cmp expect actual
185 '
186
187 test_expect_success "$cmd --stat-width=width with big change" '
188 - git $cmd $args --stat-width=40 >output
188 + git $cmd $args --stat-width=40 >output &&
189 grep " | " output >actual &&
190 test_cmp expect actual
191 '
192
193 test_expect_success "$cmd --stat-graph-width with big change" '
194 - git $cmd $args --stat-graph-width=26 >output
194 + git $cmd $args --stat-graph-width=26 >output &&
195 grep " | " output >actual &&
196 test_cmp expect actual
197 '
@@ -199,13 +199,13 @@ do
199 test "$cmd" != diff || continue
200
201 test_expect_success "$cmd --stat-width=width --graph with big change" '
202 - git $cmd $args --stat-width=40 --graph >output
202 + git $cmd $args --stat-width=40 --graph >output &&
203 grep " | " output >actual &&
204 test_cmp expect-graph actual
205 '
206
207 test_expect_success "$cmd --stat-graph-width --graph with big change" '
208 - git $cmd $args --stat-graph-width=26 --graph >output
208 + git $cmd $args --stat-graph-width=26 --graph >output &&
209 grep " | " output >actual &&
210 test_cmp expect-graph actual
211 '
@@ -265,7 +265,7 @@ EOF
265 while read verb expect cmd args
266 do
267 test_expect_success "$cmd $verb COLUMNS (long filename)" '
268 - COLUMNS=200 git $cmd $args >output
268 + COLUMNS=200 git $cmd $args >output &&
269 grep " | " output >actual &&
270 test_cmp "$expect" actual
271 '
@@ -273,7 +273,7 @@ do
273 test "$cmd" != diff || continue
274
275 test_expect_success "$cmd --graph $verb COLUMNS (long filename)" '
276 - COLUMNS=200 git $cmd $args --graph >output
276 + COLUMNS=200 git $cmd $args --graph >output &&
277 grep " | " output >actual &&
278 test_cmp "$expect-graph" actual
279 '
@@ -294,7 +294,7 @@ while read verb expect cmd args
294 do
295 test_expect_success COLUMNS_CAN_BE_1 \
296 "$cmd $verb prefix greater than COLUMNS (big change)" '
297 - COLUMNS=1 git $cmd $args >output
297 + COLUMNS=1 git $cmd $args >output &&
298 grep " | " output >actual &&
299 test_cmp "$expect" actual
300 '
@@ -303,7 +303,7 @@ do
303
304 test_expect_success COLUMNS_CAN_BE_1 \
305 "$cmd --graph $verb prefix greater than COLUMNS (big change)" '
306 - COLUMNS=1 git $cmd $args --graph >output
306 + COLUMNS=1 git $cmd $args --graph >output &&
307 grep " | " output >actual &&
308 test_cmp "$expect-graph" actual
309 '
@@ -320,7 +320,7 @@ EOF
320 test_expect_success 'merge --stat respects COLUMNS (big change)' '
321 git checkout -b branch HEAD^^ &&
322 COLUMNS=100 git merge --stat --no-ff master^ >output &&
323 - grep " | " output >actual
323 + grep " | " output >actual &&
324 test_cmp expect actual
325 '
326
@@ -329,7 +329,7 @@ cat >expect <<'EOF'
329 EOF
330 test_expect_success 'merge --stat respects COLUMNS (long filename)' '
331 COLUMNS=100 git merge --stat --no-ff master >output &&
332 - grep " | " output >actual
332 + grep " | " output >actual &&
333 test_cmp expect actual
334 '
335
t/t4212-log-corrupt.sh
+1 -1
@@ -61,7 +61,7 @@ test_expect_success 'unparsable dates produce sentinel value' '
61 test_expect_success 'unparsable dates produce sentinel value (%ad)' '
62 commit=$(munge_author_date HEAD totally_bogus) &&
63 echo >expect &&
64 - git log -1 --format=%ad $commit >actual
64 + git log -1 --format=%ad $commit >actual &&
65 test_cmp expect actual
66 '
67
t/t5551-http-fetch-smart.sh
+1 -1
@@ -209,7 +209,7 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set
209 git config http.cookiefile cookies.txt &&
210 git config http.savecookies true &&
211 git ls-remote $HTTPD_URL/smart_cookies/repo.git master &&
212 - tail -3 cookies.txt > cookies_tail.txt
212 + tail -3 cookies.txt >cookies_tail.txt &&
213 test_cmp expect_cookies.txt cookies_tail.txt
214 '
215
t/t5709-clone-refspec.sh
+1 -1
@@ -147,7 +147,7 @@ test_expect_success '--single-branch with detached' '
147 git for-each-ref refs/remotes/origin |
148 sed -e "/HEAD$/d" \
149 -e "s|/remotes/origin/|/heads/|" >../actual
150 - )
150 + ) &&
151 # nothing
152 >expect &&
153 test_cmp expect actual
t/t6028-merge-up-to-date.sh
+1 -1
@@ -83,7 +83,7 @@ test_expect_success 'merge fast-forward octopus' '
83
84 git reset --hard c0 &&
85 test_tick &&
86 - git merge c1 c2
86 + git merge c1 c2 &&
87 expect=$(git rev-parse c2) &&
88 current=$(git rev-parse HEAD) &&
89 test "$expect" = "$current"
t/t6132-pathspec-exclude.sh
+14 -14
@@ -30,7 +30,7 @@ test_expect_success 'exclude only should error out' '
30 '
31
32 test_expect_success 't_e_i() exclude sub' '
33 - git log --oneline --format=%s -- . ":(exclude)sub" >actual
33 + git log --oneline --format=%s -- . ":(exclude)sub" >actual &&
34 cat <<EOF >expect &&
35 sub2/file
36 file
@@ -39,7 +39,7 @@ EOF
39 '
40
41 test_expect_success 't_e_i() exclude sub/sub/file' '
42 - git log --oneline --format=%s -- . ":(exclude)sub/sub/file" >actual
42 + git log --oneline --format=%s -- . ":(exclude)sub/sub/file" >actual &&
43 cat <<EOF >expect &&
44 sub2/file
45 sub/sub/sub/file
@@ -51,7 +51,7 @@ EOF
51 '
52
53 test_expect_success 't_e_i() exclude sub using mnemonic' '
54 - git log --oneline --format=%s -- . ":!sub" >actual
54 + git log --oneline --format=%s -- . ":!sub" >actual &&
55 cat <<EOF >expect &&
56 sub2/file
57 file
@@ -60,7 +60,7 @@ EOF
60 '
61
62 test_expect_success 't_e_i() exclude :(icase)SUB' '
63 - git log --oneline --format=%s -- . ":(exclude,icase)SUB" >actual
63 + git log --oneline --format=%s -- . ":(exclude,icase)SUB" >actual &&
64 cat <<EOF >expect &&
65 sub2/file
66 file
@@ -71,7 +71,7 @@ EOF
71 test_expect_success 't_e_i() exclude sub2 from sub' '
72 (
73 cd sub &&
74 - git log --oneline --format=%s -- :/ ":/!sub2" >actual
74 + git log --oneline --format=%s -- :/ ":/!sub2" >actual &&
75 cat <<EOF >expect &&
76 sub/sub/sub/file
77 sub/file2
@@ -84,7 +84,7 @@ EOF
84 '
85
86 test_expect_success 't_e_i() exclude sub/*file' '
87 - git log --oneline --format=%s -- . ":(exclude)sub/*file" >actual
87 + git log --oneline --format=%s -- . ":(exclude)sub/*file" >actual &&
88 cat <<EOF >expect &&
89 sub2/file
90 sub/file2
@@ -94,7 +94,7 @@ EOF
94 '
95
96 test_expect_success 't_e_i() exclude :(glob)sub/*/file' '
97 - git log --oneline --format=%s -- . ":(exclude,glob)sub/*/file" >actual
97 + git log --oneline --format=%s -- . ":(exclude,glob)sub/*/file" >actual &&
98 cat <<EOF >expect &&
99 sub2/file
100 sub/sub/sub/file
@@ -106,7 +106,7 @@ EOF
106 '
107
108 test_expect_success 'm_p_d() exclude sub' '
109 - git ls-files -- . ":(exclude)sub" >actual
109 + git ls-files -- . ":(exclude)sub" >actual &&
110 cat <<EOF >expect &&
111 file
112 sub2/file
@@ -115,7 +115,7 @@ EOF
115 '
116
117 test_expect_success 'm_p_d() exclude sub/sub/file' '
118 - git ls-files -- . ":(exclude)sub/sub/file" >actual
118 + git ls-files -- . ":(exclude)sub/sub/file" >actual &&
119 cat <<EOF >expect &&
120 file
121 sub/file
@@ -127,7 +127,7 @@ EOF
127 '
128
129 test_expect_success 'm_p_d() exclude sub using mnemonic' '
130 - git ls-files -- . ":!sub" >actual
130 + git ls-files -- . ":!sub" >actual &&
131 cat <<EOF >expect &&
132 file
133 sub2/file
@@ -136,7 +136,7 @@ EOF
136 '
137
138 test_expect_success 'm_p_d() exclude :(icase)SUB' '
139 - git ls-files -- . ":(exclude,icase)SUB" >actual
139 + git ls-files -- . ":(exclude,icase)SUB" >actual &&
140 cat <<EOF >expect &&
141 file
142 sub2/file
@@ -147,7 +147,7 @@ EOF
147 test_expect_success 'm_p_d() exclude sub2 from sub' '
148 (
149 cd sub &&
150 - git ls-files -- :/ ":/!sub2" >actual
150 + git ls-files -- :/ ":/!sub2" >actual &&
151 cat <<EOF >expect &&
152 ../file
153 file
@@ -160,7 +160,7 @@ EOF
160 '
161
162 test_expect_success 'm_p_d() exclude sub/*file' '
163 - git ls-files -- . ":(exclude)sub/*file" >actual
163 + git ls-files -- . ":(exclude)sub/*file" >actual &&
164 cat <<EOF >expect &&
165 file
166 sub/file2
@@ -170,7 +170,7 @@ EOF
170 '
171
172 test_expect_success 'm_p_d() exclude :(glob)sub/*/file' '
173 - git ls-files -- . ":(exclude,glob)sub/*/file" >actual
173 + git ls-files -- . ":(exclude,glob)sub/*/file" >actual &&
174 cat <<EOF >expect &&
175 file
176 sub/file