@matheusbsbs / matheus-bagliano / commits / 2dec68cf8f
Fork 0

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>

Jonathan Nieder committed Oct 31, 2010 at 02:30 UTC 2dec68cf8fec760930c3bc9d13beb17e381d70a3
13 files changed +48 -48
t/t0020-crlf.sh
+1 -1
@@ -439,7 +439,7 @@ test_expect_success 'checkout when deleting .gitattributes' '
439 git rm .gitattributes &&
440 echo "contentsQ" | q_to_cr > .file2 &&
441 git add .file2 &&
442 - git commit -m third
442 + git commit -m third &&
443
444 git checkout master~1 &&
445 git checkout master &&
t/t1400-update-ref.sh
+10 -10
@@ -185,55 +185,55 @@ gd="Thu, 26 May 2005 18:33:00 -0500"
185 ld="Thu, 26 May 2005 18:43:00 -0500"
186 test_expect_success \
187 'Query "master@{May 25 2005}" (before history)' \
188 - 'rm -f o e
188 + 'rm -f o e &&
189 git rev-parse --verify "master@{May 25 2005}" >o 2>e &&
190 test '"$C"' = $(cat o) &&
191 test "warning: Log for '\'master\'' only goes back to $ed." = "$(cat e)"'
192 test_expect_success \
193 "Query master@{2005-05-25} (before history)" \
194 - 'rm -f o e
194 + 'rm -f o e &&
195 git rev-parse --verify master@{2005-05-25} >o 2>e &&
196 test '"$C"' = $(cat o) &&
197 echo test "warning: Log for '\'master\'' only goes back to $ed." = "$(cat e)"'
198 test_expect_success \
199 'Query "master@{May 26 2005 23:31:59}" (1 second before history)' \
200 - 'rm -f o e
200 + 'rm -f o e &&
201 git rev-parse --verify "master@{May 26 2005 23:31:59}" >o 2>e &&
202 test '"$C"' = $(cat o) &&
203 test "warning: Log for '\''master'\'' only goes back to $ed." = "$(cat e)"'
204 test_expect_success \
205 'Query "master@{May 26 2005 23:32:00}" (exactly history start)' \
206 - 'rm -f o e
206 + 'rm -f o e &&
207 git rev-parse --verify "master@{May 26 2005 23:32:00}" >o 2>e &&
208 test '"$C"' = $(cat o) &&
209 test "" = "$(cat e)"'
210 test_expect_success \
211 'Query "master@{May 26 2005 23:32:30}" (first non-creation change)' \
212 - 'rm -f o e
212 + 'rm -f o e &&
213 git rev-parse --verify "master@{May 26 2005 23:32:30}" >o 2>e &&
214 test '"$A"' = $(cat o) &&
215 test "" = "$(cat e)"'
216 test_expect_success \
217 'Query "master@{2005-05-26 23:33:01}" (middle of history with gap)' \
218 - 'rm -f o e
218 + 'rm -f o e &&
219 git rev-parse --verify "master@{2005-05-26 23:33:01}" >o 2>e &&
220 test '"$B"' = $(cat o) &&
221 test "warning: Log .git/logs/'"$m has gap after $gd"'." = "$(cat e)"'
222 test_expect_success \
223 'Query "master@{2005-05-26 23:38:00}" (middle of history)' \
224 - 'rm -f o e
224 + 'rm -f o e &&
225 git rev-parse --verify "master@{2005-05-26 23:38:00}" >o 2>e &&
226 test '"$Z"' = $(cat o) &&
227 test "" = "$(cat e)"'
228 test_expect_success \
229 'Query "master@{2005-05-26 23:43:00}" (exact end of history)' \
230 - 'rm -f o e
230 + 'rm -f o e &&
231 git rev-parse --verify "master@{2005-05-26 23:43:00}" >o 2>e &&
232 test '"$E"' = $(cat o) &&
233 test "" = "$(cat e)"'
234 test_expect_success \
235 'Query "master@{2005-05-28}" (past end of history)' \
236 - 'rm -f o e
236 + 'rm -f o e &&
237 git rev-parse --verify "master@{2005-05-28}" >o 2>e &&
238 test '"$D"' = $(cat o) &&
239 test "warning: Log .git/logs/'"$m unexpectedly ended on $ld"'." = "$(cat e)"'
@@ -247,7 +247,7 @@ test_expect_success \
247 git add F &&
248 GIT_AUTHOR_DATE="2005-05-26 23:30" \
249 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) &&
251 echo The other day this did not work. >M &&
252 echo And then Bob told me how to fix it. >>M &&
253 echo OTHER >F &&
t/t3301-notes.sh
+3 -3
@@ -627,16 +627,16 @@ test_expect_success '--show-notes=ref accumulates' '
627
628 test_expect_success 'Allow notes on non-commits (trees, blobs, tags)' '
629 git config core.notesRef refs/notes/other &&
630 - echo "Note on a tree" > expect
630 + echo "Note on a tree" > expect &&
631 git notes add -m "Note on a tree" HEAD: &&
632 git notes show HEAD: > actual &&
633 test_cmp expect actual &&
634 - echo "Note on a blob" > expect
634 + echo "Note on a blob" > expect &&
635 filename=$(git ls-tree --name-only HEAD | head -n1) &&
636 git notes add -m "Note on a blob" HEAD:$filename &&
637 git notes show HEAD:$filename > actual &&
638 test_cmp expect actual &&
639 - echo "Note on a tag" > expect
639 + echo "Note on a tag" > expect &&
640 git tag -a -m "This is an annotated tag" foobar HEAD^ &&
641 git notes add -m "Note on a tag" foobar &&
642 git notes show foobar > actual &&
t/t3404-rebase-interactive.sh
+3 -3
@@ -46,7 +46,7 @@ test_expect_success 'setup' '
46 test_commit G file1 &&
47 test_commit H file5 &&
48 git checkout -b branch2 F &&
49 - test_commit I file6
49 + test_commit I file6 &&
50 git checkout -b conflict-branch A &&
51 for n in one two three four
52 do
@@ -584,7 +584,7 @@ test_expect_success 'do "noop" when there is nothing to cherry-pick' '
584
585 git checkout -b branch4 HEAD &&
586 GIT_EDITOR=: git commit --amend \
587 - --author="Somebody else <somebody@else.com>"
587 + --author="Somebody else <somebody@else.com>" &&
588 test $(git rev-parse branch3) != $(git rev-parse branch4) &&
589 git rebase -i branch3 &&
590 test $(git rev-parse branch3) = $(git rev-parse branch4)
@@ -599,7 +599,7 @@ test_expect_success 'submodule rebase setup' '
599 git add elif && git commit -m "submodule initial"
600 ) &&
601 echo 1 >file1 &&
602 - git add file1 sub
602 + git add file1 sub &&
603 test_tick &&
604 git commit -m "One" &&
605 echo 2 >file1 &&
t/t4124-apply-ws-rule.sh
+3 -3
@@ -368,7 +368,7 @@ test_expect_success 'missing blanks at EOF must only match blank lines' '
368 git diff -- one >patch &&
369
370 echo a >one &&
371 - test_must_fail git apply patch
371 + test_must_fail git apply patch &&
372 test_must_fail git apply --whitespace=fix patch &&
373 test_must_fail git apply --ignore-space-change --whitespace=fix patch
374 '
@@ -419,7 +419,7 @@ test_expect_success 'same, but with CR-LF line endings && cr-at-eol set' '
419 printf "b\r\n" >>one &&
420 printf "c\r\n" >>one &&
421 cp one save-one &&
422 - printf " \r\n" >>one
422 + printf " \r\n" >>one &&
423 git add one &&
424 printf "d\r\n" >>one &&
425 cp one expect &&
@@ -436,7 +436,7 @@ test_expect_success 'same, but with CR-LF line endings && cr-at-eol unset' '
436 printf "b\r\n" >>one &&
437 printf "c\r\n" >>one &&
438 cp one save-one &&
439 - printf " \r\n" >>one
439 + printf " \r\n" >>one &&
440 git add one &&
441 cp one expect &&
442 printf "d\r\n" >>one &&
t/t5503-tagfollow.sh
+3 -3
@@ -54,7 +54,7 @@ EOF
54 '
55
56 test_expect_success NOT_MINGW 'fetch A (new commit : 1 connection)' '
57 - rm -f $U
57 + rm -f $U &&
58 (
59 cd cloned &&
60 GIT_DEBUG_SEND_PACK=3 git fetch 3>../$U &&
@@ -87,7 +87,7 @@ EOF
87 '
88
89 test_expect_success NOT_MINGW 'fetch C, T (new branch, tag : 1 connection)' '
90 - rm -f $U
90 + rm -f $U &&
91 (
92 cd cloned &&
93 GIT_DEBUG_SEND_PACK=3 git fetch 3>../$U &&
@@ -126,7 +126,7 @@ EOF
126 '
127
128 test_expect_success NOT_MINGW 'fetch B, S (commit and tag : 1 connection)' '
129 - rm -f $U
129 + rm -f $U &&
130 (
131 cd cloned &&
132 GIT_DEBUG_SEND_PACK=3 git fetch 3>../$U &&
t/t5701-clone-local.sh
+3 -3
@@ -10,11 +10,11 @@ test_expect_success 'preparing origin repository' '
10 git clone --bare . a.git &&
11 git clone --bare . x &&
12 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 &&
14 git bundle create b1.bundle --all &&
15 git bundle create b2.bundle master &&
16 mkdir dir &&
17 - cp b1.bundle dir/b3
17 + cp b1.bundle dir/b3 &&
18 cp b1.bundle b4
19 '
20
@@ -112,7 +112,7 @@ test_expect_success 'bundle clone with nonexistent HEAD' '
112 cd "$D" &&
113 git clone b2.bundle b2 &&
114 cd b2 &&
115 - git fetch
115 + git fetch &&
116 test ! -e .git/refs/heads/master
117 '
118
t/t7001-mv.sh
+1 -1
@@ -207,7 +207,7 @@ test_expect_success 'git mv should not change sha1 of moved cache entry' '
207 git init &&
208 echo 1 >dirty &&
209 git add dirty &&
210 - entry="$(git ls-files --stage dirty | cut -f 1)"
210 + entry="$(git ls-files --stage dirty | cut -f 1)" &&
211 git mv dirty dirty2 &&
212 [ "$entry" = "$(git ls-files --stage dirty2 | cut -f 1)" ] &&
213 echo 2 >dirty2 &&
t/t7004-tag.sh
+15 -15
@@ -1097,7 +1097,7 @@ hash1=$(git rev-parse HEAD)
1097 test_expect_success 'creating second commit and tag' '
1098 echo foo-2.0 >foo &&
1099 git add foo &&
1100 - git commit -m second
1100 + git commit -m second &&
1101 git tag v2.0
1102 '
1103
@@ -1122,18 +1122,18 @@ v2.0
1122 EOF
1123
1124 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 &&
1126 test_cmp expected actual
1127 "
1128
1129 # other ways of specifying the commit
1130 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 &&
1132 test_cmp expected actual
1133 "
1134
1135 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 &&
1137 test_cmp expected actual
1138 "
1139
@@ -1142,7 +1142,7 @@ v2.0
1142 EOF
1143
1144 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 &&
1146 test_cmp expected actual
1147 "
1148
@@ -1151,7 +1151,7 @@ cat > expected <<EOF
1151 EOF
1152
1153 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 &&
1155 test_cmp expected actual
1156 "
1157
@@ -1161,7 +1161,7 @@ test_expect_success 'creating simple branch' '
1161 git branch stable v2.0 &&
1162 git checkout stable &&
1163 echo foo-3.0 > foo &&
1164 - git commit foo -m fourth
1164 + git commit foo -m fourth &&
1165 git tag v3.0
1166 '
1167
@@ -1172,7 +1172,7 @@ v3.0
1172 EOF
1173
1174 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 &&
1176 test_cmp expected actual
1177 "
1178
@@ -1186,7 +1186,7 @@ v4.0
1186 EOF
1187
1188 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 &&
1190 test_cmp expected actual
1191 "
1192
@@ -1201,18 +1201,18 @@ v4.0
1201 EOF
1202
1203 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 &&
1205 test_cmp expected actual
1206 "
1207
1208 # mixing modes and options:
1209
1210 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 &&
1216 test_must_fail git tag -v -s
1217 '
1218
t/t7300-clean.sh
+1 -1
@@ -183,7 +183,7 @@ test_expect_success 'git clean symbolic link' '
183
184 mkdir -p build docs &&
185 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 &&
187 git clean &&
188 test -f Makefile &&
189 test -f README &&
t/t7502-commit.sh
+1 -1
@@ -390,7 +390,7 @@ try_commit_status_combo () {
390
391 test_expect_success 'commit --no-status' '
392 clear_config commit.status &&
393 - try_commit --no-status
393 + try_commit --no-status &&
394 ! grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
395 '
396
t/t7700-repack.sh
+3 -3
@@ -56,7 +56,7 @@ test_expect_success 'loose objects in alternate ODB are not repacked' '
56 '
57
58 test_expect_success 'packed obs in alt ODB are repacked even when local repo is packless' '
59 - mkdir alt_objects/pack
59 + mkdir alt_objects/pack &&
60 mv .git/objects/pack/* alt_objects/pack &&
61 git repack -a &&
62 myidx=$(ls -1 .git/objects/pack/*.idx) &&
@@ -95,14 +95,14 @@ test_expect_success 'packed obs in alternate ODB kept pack are repacked' '
95 # swap the .keep so the commit object is in the pack with .keep
96 for p in alt_objects/pack/*.pack
97 do
98 - base_name=$(basename $p .pack)
98 + base_name=$(basename $p .pack) &&
99 if test -f alt_objects/pack/$base_name.keep
100 then
101 rm alt_objects/pack/$base_name.keep
102 else
103 touch alt_objects/pack/$base_name.keep
104 fi
105 - done
105 + done &&
106 git repack -a -d &&
107 myidx=$(ls -1 .git/objects/pack/*.idx) &&
108 test -f "$myidx" &&
t/t9146-git-svn-empty-dirs.sh
+1 -1
@@ -33,7 +33,7 @@ test_expect_success 'more emptiness' '
33 '
34
35 test_expect_success 'git svn rebase creates empty directory' '
36 - ( cd cloned && git svn rebase )
36 + ( cd cloned && git svn rebase ) &&
37 test -d cloned/"! !"
38 '
39