Skip to content

Commit 2dec68c

Browse files
jrngitster
authored andcommitted
tests: add missing &&, batch 2
Same rules as before: this patch only adds " &&" to the end of some lines in the test suite. Intended to be applied on top of or squashed with the last batch if they look okay. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent a48fcd8 commit 2dec68c

13 files changed

+48
-48
lines changed

t/t0020-crlf.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ test_expect_success 'checkout when deleting .gitattributes' '
439439
git rm .gitattributes &&
440440
echo "contentsQ" | q_to_cr > .file2 &&
441441
git add .file2 &&
442-
git commit -m third
442+
git commit -m third &&
443443
444444
git checkout master~1 &&
445445
git checkout master &&

t/t1400-update-ref.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -185,55 +185,55 @@ gd="Thu, 26 May 2005 18:33:00 -0500"
185185
ld="Thu, 26 May 2005 18:43:00 -0500"
186186
test_expect_success \
187187
'Query "master@{May 25 2005}" (before history)' \
188-
'rm -f o e
188+
'rm -f o e &&
189189
git rev-parse --verify "master@{May 25 2005}" >o 2>e &&
190190
test '"$C"' = $(cat o) &&
191191
test "warning: Log for '\'master\'' only goes back to $ed." = "$(cat e)"'
192192
test_expect_success \
193193
"Query master@{2005-05-25} (before history)" \
194-
'rm -f o e
194+
'rm -f o e &&
195195
git rev-parse --verify master@{2005-05-25} >o 2>e &&
196196
test '"$C"' = $(cat o) &&
197197
echo test "warning: Log for '\'master\'' only goes back to $ed." = "$(cat e)"'
198198
test_expect_success \
199199
'Query "master@{May 26 2005 23:31:59}" (1 second before history)' \
200-
'rm -f o e
200+
'rm -f o e &&
201201
git rev-parse --verify "master@{May 26 2005 23:31:59}" >o 2>e &&
202202
test '"$C"' = $(cat o) &&
203203
test "warning: Log for '\''master'\'' only goes back to $ed." = "$(cat e)"'
204204
test_expect_success \
205205
'Query "master@{May 26 2005 23:32:00}" (exactly history start)' \
206-
'rm -f o e
206+
'rm -f o e &&
207207
git rev-parse --verify "master@{May 26 2005 23:32:00}" >o 2>e &&
208208
test '"$C"' = $(cat o) &&
209209
test "" = "$(cat e)"'
210210
test_expect_success \
211211
'Query "master@{May 26 2005 23:32:30}" (first non-creation change)' \
212-
'rm -f o e
212+
'rm -f o e &&
213213
git rev-parse --verify "master@{May 26 2005 23:32:30}" >o 2>e &&
214214
test '"$A"' = $(cat o) &&
215215
test "" = "$(cat e)"'
216216
test_expect_success \
217217
'Query "master@{2005-05-26 23:33:01}" (middle of history with gap)' \
218-
'rm -f o e
218+
'rm -f o e &&
219219
git rev-parse --verify "master@{2005-05-26 23:33:01}" >o 2>e &&
220220
test '"$B"' = $(cat o) &&
221221
test "warning: Log .git/logs/'"$m has gap after $gd"'." = "$(cat e)"'
222222
test_expect_success \
223223
'Query "master@{2005-05-26 23:38:00}" (middle of history)' \
224-
'rm -f o e
224+
'rm -f o e &&
225225
git rev-parse --verify "master@{2005-05-26 23:38:00}" >o 2>e &&
226226
test '"$Z"' = $(cat o) &&
227227
test "" = "$(cat e)"'
228228
test_expect_success \
229229
'Query "master@{2005-05-26 23:43:00}" (exact end of history)' \
230-
'rm -f o e
230+
'rm -f o e &&
231231
git rev-parse --verify "master@{2005-05-26 23:43:00}" >o 2>e &&
232232
test '"$E"' = $(cat o) &&
233233
test "" = "$(cat e)"'
234234
test_expect_success \
235235
'Query "master@{2005-05-28}" (past end of history)' \
236-
'rm -f o e
236+
'rm -f o e &&
237237
git rev-parse --verify "master@{2005-05-28}" >o 2>e &&
238238
test '"$D"' = $(cat o) &&
239239
test "warning: Log .git/logs/'"$m unexpectedly ended on $ld"'." = "$(cat e)"'
@@ -247,7 +247,7 @@ test_expect_success \
247247
git add F &&
248248
GIT_AUTHOR_DATE="2005-05-26 23:30" \
249249
GIT_COMMITTER_DATE="2005-05-26 23:30" git commit -m add -a &&
250-
h_TEST=$(git rev-parse --verify HEAD)
250+
h_TEST=$(git rev-parse --verify HEAD) &&
251251
echo The other day this did not work. >M &&
252252
echo And then Bob told me how to fix it. >>M &&
253253
echo OTHER >F &&

t/t3301-notes.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,16 +627,16 @@ test_expect_success '--show-notes=ref accumulates' '
627627

628628
test_expect_success 'Allow notes on non-commits (trees, blobs, tags)' '
629629
git config core.notesRef refs/notes/other &&
630-
echo "Note on a tree" > expect
630+
echo "Note on a tree" > expect &&
631631
git notes add -m "Note on a tree" HEAD: &&
632632
git notes show HEAD: > actual &&
633633
test_cmp expect actual &&
634-
echo "Note on a blob" > expect
634+
echo "Note on a blob" > expect &&
635635
filename=$(git ls-tree --name-only HEAD | head -n1) &&
636636
git notes add -m "Note on a blob" HEAD:$filename &&
637637
git notes show HEAD:$filename > actual &&
638638
test_cmp expect actual &&
639-
echo "Note on a tag" > expect
639+
echo "Note on a tag" > expect &&
640640
git tag -a -m "This is an annotated tag" foobar HEAD^ &&
641641
git notes add -m "Note on a tag" foobar &&
642642
git notes show foobar > actual &&

t/t3404-rebase-interactive.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ test_expect_success 'setup' '
4646
test_commit G file1 &&
4747
test_commit H file5 &&
4848
git checkout -b branch2 F &&
49-
test_commit I file6
49+
test_commit I file6 &&
5050
git checkout -b conflict-branch A &&
5151
for n in one two three four
5252
do
@@ -584,7 +584,7 @@ test_expect_success 'do "noop" when there is nothing to cherry-pick' '
584584
585585
git checkout -b branch4 HEAD &&
586586
GIT_EDITOR=: git commit --amend \
587-
--author="Somebody else <somebody@else.com>"
587+
--author="Somebody else <somebody@else.com>" &&
588588
test $(git rev-parse branch3) != $(git rev-parse branch4) &&
589589
git rebase -i branch3 &&
590590
test $(git rev-parse branch3) = $(git rev-parse branch4)
@@ -599,7 +599,7 @@ test_expect_success 'submodule rebase setup' '
599599
git add elif && git commit -m "submodule initial"
600600
) &&
601601
echo 1 >file1 &&
602-
git add file1 sub
602+
git add file1 sub &&
603603
test_tick &&
604604
git commit -m "One" &&
605605
echo 2 >file1 &&

t/t4124-apply-ws-rule.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ test_expect_success 'missing blanks at EOF must only match blank lines' '
368368
git diff -- one >patch &&
369369
370370
echo a >one &&
371-
test_must_fail git apply patch
371+
test_must_fail git apply patch &&
372372
test_must_fail git apply --whitespace=fix patch &&
373373
test_must_fail git apply --ignore-space-change --whitespace=fix patch
374374
'
@@ -419,7 +419,7 @@ test_expect_success 'same, but with CR-LF line endings && cr-at-eol set' '
419419
printf "b\r\n" >>one &&
420420
printf "c\r\n" >>one &&
421421
cp one save-one &&
422-
printf " \r\n" >>one
422+
printf " \r\n" >>one &&
423423
git add one &&
424424
printf "d\r\n" >>one &&
425425
cp one expect &&
@@ -436,7 +436,7 @@ test_expect_success 'same, but with CR-LF line endings && cr-at-eol unset' '
436436
printf "b\r\n" >>one &&
437437
printf "c\r\n" >>one &&
438438
cp one save-one &&
439-
printf " \r\n" >>one
439+
printf " \r\n" >>one &&
440440
git add one &&
441441
cp one expect &&
442442
printf "d\r\n" >>one &&

t/t5503-tagfollow.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ EOF
5454
'
5555

5656
test_expect_success NOT_MINGW 'fetch A (new commit : 1 connection)' '
57-
rm -f $U
57+
rm -f $U &&
5858
(
5959
cd cloned &&
6060
GIT_DEBUG_SEND_PACK=3 git fetch 3>../$U &&
@@ -87,7 +87,7 @@ EOF
8787
'
8888

8989
test_expect_success NOT_MINGW 'fetch C, T (new branch, tag : 1 connection)' '
90-
rm -f $U
90+
rm -f $U &&
9191
(
9292
cd cloned &&
9393
GIT_DEBUG_SEND_PACK=3 git fetch 3>../$U &&
@@ -126,7 +126,7 @@ EOF
126126
'
127127

128128
test_expect_success NOT_MINGW 'fetch B, S (commit and tag : 1 connection)' '
129-
rm -f $U
129+
rm -f $U &&
130130
(
131131
cd cloned &&
132132
GIT_DEBUG_SEND_PACK=3 git fetch 3>../$U &&

t/t5701-clone-local.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ test_expect_success 'preparing origin repository' '
1010
git clone --bare . a.git &&
1111
git clone --bare . x &&
1212
test "$(GIT_CONFIG=a.git/config git config --bool core.bare)" = true &&
13-
test "$(GIT_CONFIG=x/config git config --bool core.bare)" = true
13+
test "$(GIT_CONFIG=x/config git config --bool core.bare)" = true &&
1414
git bundle create b1.bundle --all &&
1515
git bundle create b2.bundle master &&
1616
mkdir dir &&
17-
cp b1.bundle dir/b3
17+
cp b1.bundle dir/b3 &&
1818
cp b1.bundle b4
1919
'
2020

@@ -112,7 +112,7 @@ test_expect_success 'bundle clone with nonexistent HEAD' '
112112
cd "$D" &&
113113
git clone b2.bundle b2 &&
114114
cd b2 &&
115-
git fetch
115+
git fetch &&
116116
test ! -e .git/refs/heads/master
117117
'
118118

t/t7001-mv.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ test_expect_success 'git mv should not change sha1 of moved cache entry' '
207207
git init &&
208208
echo 1 >dirty &&
209209
git add dirty &&
210-
entry="$(git ls-files --stage dirty | cut -f 1)"
210+
entry="$(git ls-files --stage dirty | cut -f 1)" &&
211211
git mv dirty dirty2 &&
212212
[ "$entry" = "$(git ls-files --stage dirty2 | cut -f 1)" ] &&
213213
echo 2 >dirty2 &&

t/t7004-tag.sh

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ hash1=$(git rev-parse HEAD)
10971097
test_expect_success 'creating second commit and tag' '
10981098
echo foo-2.0 >foo &&
10991099
git add foo &&
1100-
git commit -m second
1100+
git commit -m second &&
11011101
git tag v2.0
11021102
'
11031103
@@ -1122,18 +1122,18 @@ v2.0
11221122
EOF
11231123
11241124
test_expect_success 'checking that first commit is in all tags (hash)' "
1125-
git tag -l --contains $hash1 v* >actual
1125+
git tag -l --contains $hash1 v* >actual &&
11261126
test_cmp expected actual
11271127
"
11281128
11291129
# other ways of specifying the commit
11301130
test_expect_success 'checking that first commit is in all tags (tag)' "
1131-
git tag -l --contains v1.0 v* >actual
1131+
git tag -l --contains v1.0 v* >actual &&
11321132
test_cmp expected actual
11331133
"
11341134
11351135
test_expect_success 'checking that first commit is in all tags (relative)' "
1136-
git tag -l --contains HEAD~2 v* >actual
1136+
git tag -l --contains HEAD~2 v* >actual &&
11371137
test_cmp expected actual
11381138
"
11391139
@@ -1142,7 +1142,7 @@ v2.0
11421142
EOF
11431143
11441144
test_expect_success 'checking that second commit only has one tag' "
1145-
git tag -l --contains $hash2 v* >actual
1145+
git tag -l --contains $hash2 v* >actual &&
11461146
test_cmp expected actual
11471147
"
11481148
@@ -1151,7 +1151,7 @@ cat > expected <<EOF
11511151
EOF
11521152
11531153
test_expect_success 'checking that third commit has no tags' "
1154-
git tag -l --contains $hash3 v* >actual
1154+
git tag -l --contains $hash3 v* >actual &&
11551155
test_cmp expected actual
11561156
"
11571157
@@ -1161,7 +1161,7 @@ test_expect_success 'creating simple branch' '
11611161
git branch stable v2.0 &&
11621162
git checkout stable &&
11631163
echo foo-3.0 > foo &&
1164-
git commit foo -m fourth
1164+
git commit foo -m fourth &&
11651165
git tag v3.0
11661166
'
11671167
@@ -1172,7 +1172,7 @@ v3.0
11721172
EOF
11731173
11741174
test_expect_success 'checking that branch head only has one tag' "
1175-
git tag -l --contains $hash4 v* >actual
1175+
git tag -l --contains $hash4 v* >actual &&
11761176
test_cmp expected actual
11771177
"
11781178
@@ -1186,7 +1186,7 @@ v4.0
11861186
EOF
11871187
11881188
test_expect_success 'checking that original branch head has one tag now' "
1189-
git tag -l --contains $hash3 v* >actual
1189+
git tag -l --contains $hash3 v* >actual &&
11901190
test_cmp expected actual
11911191
"
11921192
@@ -1201,18 +1201,18 @@ v4.0
12011201
EOF
12021202
12031203
test_expect_success 'checking that initial commit is in all tags' "
1204-
git tag -l --contains $hash1 v* >actual
1204+
git tag -l --contains $hash1 v* >actual &&
12051205
test_cmp expected actual
12061206
"
12071207
12081208
# mixing modes and options:
12091209
12101210
test_expect_success 'mixing incompatibles modes and options is forbidden' '
1211-
test_must_fail git tag -a
1212-
test_must_fail git tag -l -v
1213-
test_must_fail git tag -n 100
1214-
test_must_fail git tag -l -m msg
1215-
test_must_fail git tag -l -F some file
1211+
test_must_fail git tag -a &&
1212+
test_must_fail git tag -l -v &&
1213+
test_must_fail git tag -n 100 &&
1214+
test_must_fail git tag -l -m msg &&
1215+
test_must_fail git tag -l -F some file &&
12161216
test_must_fail git tag -v -s
12171217
'
12181218

t/t7300-clean.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ test_expect_success 'git clean symbolic link' '
183183
184184
mkdir -p build docs &&
185185
touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
186-
ln -s docs/manual.txt src/part4.c
186+
ln -s docs/manual.txt src/part4.c &&
187187
git clean &&
188188
test -f Makefile &&
189189
test -f README &&

0 commit comments

Comments
 (0)