t9402: Add missing &&; Code style

Add missing && at 2 places Re-formated the sub-shell parantheses (coding style) Added missing ] in the test_expect_success header at 2 places Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Torsten Bögershausen committed Dec 8, 2012 at 22:34 UTC bd6f62c3ff61873dc6a323020162067536283a53
1 file changed +50 -56
t/t9402-git-cvsserver-refs.sh
+50 -56
@@ -54,10 +54,12 @@ check_diff() {
54 vNew="$3"
55 rm -rf diffSandbox
56 git clone -q -n . diffSandbox &&
57 - ( cd diffSandbox &&
57 + (
58 + cd diffSandbox &&
59 git checkout "$vOld" &&
60 git apply -p0 --index <"../$diffFile" &&
60 - git diff --exit-code "$vNew" ) >check_diff_apply.out 2>&1
61 + git diff --exit-code "$vNew"
62 + ) >check_diff_apply.out 2>&1
63 }
64
65 #########
@@ -149,7 +151,8 @@ test_expect_success 'cvs co b1 [cvswork3]' '
151 '
152
153 test_expect_success 'edit cvswork3 and save diff' '
152 - ( cd cvswork3 &&
154 + (
155 + cd cvswork3 &&
156 sed -e "s/line1/line1 - data/" adir/afile >adir/afileNEW &&
157 mv -f adir/afileNEW adir/afile &&
158 echo "afile5" >adir/afile5 &&
@@ -180,8 +183,7 @@ test_expect_success 'setup v1.2 on b1' '
183 '
184
185 test_expect_success 'cvs -f up (on b1 adir)' '
183 - ( cd cvswork/adir &&
184 - cvs -f up -d ) >cvs.log 2>&1 &&
186 + ( cd cvswork/adir && cvs -f up -d ) >cvs.log 2>&1 &&
187 check_start_tree cvswork &&
188 check_file cvswork textfile.c v1 &&
189 check_file cvswork t2 v1 &&
@@ -193,8 +195,7 @@ test_expect_success 'cvs -f up (on b1 adir)' '
195 '
196
197 test_expect_success 'cvs up (on b1 /)' '
196 - ( cd cvswork &&
197 - cvs -f up -d ) >cvs.log 2>&1 &&
198 + ( cd cvswork && cvs -f up -d ) >cvs.log 2>&1 &&
199 check_start_tree cvswork &&
200 check_file cvswork textfile.c v1.2 &&
201 check_file cvswork t3 v1.2 &&
@@ -208,8 +209,7 @@ test_expect_success 'cvs up (on b1 /)' '
209
210 # Make sure "CVS/Tag" files didn't get messed up:
211 test_expect_success 'cvs up (on b1 /) (again; check CVS/Tag files)' '
211 - ( cd cvswork &&
212 - cvs -f up -d ) >cvs.log 2>&1 &&
212 + ( cd cvswork && cvs -f up -d ) >cvs.log 2>&1 &&
213 check_start_tree cvswork &&
214 check_file cvswork textfile.c v1.2 &&
215 check_file cvswork t3 v1.2 &&
@@ -223,8 +223,7 @@ test_expect_success 'cvs up (on b1 /) (again; check CVS/Tag files)' '
223
224 # update to another version:
225 test_expect_success 'cvs up -r v1' '
226 - ( cd cvswork &&
227 - cvs -f up -r v1 ) >cvs.log 2>&1 &&
226 + ( cd cvswork && cvs -f up -r v1 ) >cvs.log 2>&1 &&
227 check_start_tree cvswork &&
228 check_file cvswork textfile.c v1 &&
229 check_file cvswork t2 v1 &&
@@ -236,8 +235,7 @@ test_expect_success 'cvs up -r v1' '
235 '
236
237 test_expect_success 'cvs up' '
239 - ( cd cvswork &&
240 - cvs -f up ) >cvs.log 2>&1 &&
238 + ( cd cvswork && cvs -f up ) >cvs.log 2>&1 &&
239 check_start_tree cvswork &&
240 check_file cvswork textfile.c v1 &&
241 check_file cvswork t2 v1 &&
@@ -249,8 +247,7 @@ test_expect_success 'cvs up' '
247 '
248
249 test_expect_success 'cvs up (again; check CVS/Tag files)' '
252 - ( cd cvswork &&
253 - cvs -f up -d ) >cvs.log 2>&1 &&
250 + ( cd cvswork && cvs -f up -d ) >cvs.log 2>&1 &&
251 check_start_tree cvswork &&
252 check_file cvswork textfile.c v1 &&
253 check_file cvswork t2 v1 &&
@@ -279,15 +276,16 @@ test_expect_success 'cvs co b2 [into cvswork2]' '
276 '
277
278 test_expect_success 'root dir edit [cvswork2]' '
282 - ( cd cvswork2 &&
283 - echo "Line 2" >>textfile.c &&
279 + (
280 + cd cvswork2 && echo "Line 2" >>textfile.c &&
281 ! cvs -f diff -u >"$WORKDIR/cvsEdit1.diff" &&
282 cvs -f commit -m "edit textfile.c" textfile.c
283 ) >cvsEdit1.log 2>&1
284 '
285
286 test_expect_success 'root dir rm file [cvswork2]' '
290 - ( cd cvswork2 &&
287 + (
288 + cd cvswork2 &&
289 cvs -f rm -f t2 &&
290 cvs -f diff -u >../cvsEdit2-empty.diff &&
291 ! cvs -f diff -N -u >"$WORKDIR/cvsEdit2-N.diff" &&
@@ -295,8 +293,9 @@ test_expect_success 'root dir rm file [cvswork2]' '
293 ) >cvsEdit2.log 2>&1
294 '
295
298 -test_expect_success 'subdir edit/add/rm files [cvswork2' '
299 - ( cd cvswork2 &&
296 +test_expect_success 'subdir edit/add/rm files [cvswork2]' '
297 + (
298 + cd cvswork2 &&
299 sed -e "s/line 1/line 1 (v2)/" adir/bdir/bfile >adir/bdir/bfileNEW &&
300 mv -f adir/bdir/bfileNEW adir/bdir/bfile &&
301 rm adir/bdir/b2file &&
@@ -306,7 +305,8 @@ test_expect_success 'subdir edit/add/rm files [cvswork2' '
305 cvs -f add bdir/b4file &&
306 ! cvs -f diff -N -u >"$WORKDIR/cvsEdit3.diff" &&
307 git fetch gitcvs.git b2:b2 &&
309 - ( cd .. &&
308 + (
309 + cd .. &&
310 ! cvs -f diff -u -N -r v1.2 >"$WORKDIR/cvsEdit3-v1.2.diff" &&
311 ! cvs -f diff -u -N -r v1.2 -r v1 >"$WORKDIR/cvsEdit3-v1.2-v1.diff"
312 ) &&
@@ -334,12 +334,14 @@ test_expect_success 'validate basic diffs saved during above cvswork2 edits' '
334 test $(grep Index: cvsEdit3.diff | wc -l) = 3 &&
335 rm -rf diffSandbox &&
336 git clone -q -n . diffSandbox &&
337 - ( cd diffSandbox &&
337 + (
338 + cd diffSandbox &&
339 git checkout v1 &&
340 git apply -p0 --index <"$WORKDIR/cvsEdit1.diff" &&
341 git apply -p0 --index <"$WORKDIR/cvsEdit2-N.diff" &&
342 git apply -p0 --directory=adir --index <"$WORKDIR/cvsEdit3.diff" &&
342 - git diff --exit-code v2 ) >"check_diff_apply.out" 2>&1
343 + git diff --exit-code v2
344 + ) >"check_diff_apply.out" 2>&1
345 '
346
347 test_expect_success 'validate v1.2 diff saved during last cvswork2 edit' '
@@ -353,8 +355,7 @@ test_expect_success 'validate v1.2 v1 diff saved during last cvswork2 edit' '
355 '
356
357 test_expect_success 'cvs up [cvswork2]' '
356 - ( cd cvswork2 &&
357 - cvs -f up ) >cvs.log 2>&1 &&
358 + ( cd cvswork2 && cvs -f up ) >cvs.log 2>&1 &&
359 check_start_tree cvswork2 &&
360 check_file cvswork2 textfile.c v2 &&
361 check_file cvswork2 adir/afile v2 &&
@@ -365,8 +366,7 @@ test_expect_success 'cvs up [cvswork2]' '
366 '
367
368 test_expect_success 'cvs up -r b2 [back to cvswork]' '
368 - ( cd cvswork &&
369 - cvs -f up -r b2 ) >cvs.log 2>&1 &&
369 + ( cd cvswork && cvs -f up -r b2 ) >cvs.log 2>&1 &&
370 check_start_tree cvswork &&
371 check_file cvswork textfile.c v2 &&
372 check_file cvswork adir/afile v2 &&
@@ -377,8 +377,7 @@ test_expect_success 'cvs up -r b2 [back to cvswork]' '
377 '
378
379 test_expect_success 'cvs up -r b1' '
380 - ( cd cvswork &&
381 - cvs -f up -r b1 ) >cvs.log 2>&1 &&
380 + ( cd cvswork && cvs -f up -r b1 ) >cvs.log 2>&1 &&
381 check_start_tree cvswork &&
382 check_file cvswork textfile.c v1.2 &&
383 check_file cvswork t3 v1.2 &&
@@ -391,8 +390,7 @@ test_expect_success 'cvs up -r b1' '
390 '
391
392 test_expect_success 'cvs up -A' '
394 - ( cd cvswork &&
395 - cvs -f up -A ) >cvs.log 2>&1 &&
393 + ( cd cvswork && cvs -f up -A ) >cvs.log 2>&1 &&
394 check_start_tree cvswork &&
395 check_file cvswork textfile.c v1 &&
396 check_file cvswork t2 v1 &&
@@ -404,8 +402,7 @@ test_expect_success 'cvs up -A' '
402 '
403
404 test_expect_success 'cvs up (check CVS/Tag files)' '
407 - ( cd cvswork &&
408 - cvs -f up ) >cvs.log 2>&1 &&
405 + ( cd cvswork && cvs -f up ) >cvs.log 2>&1 &&
406 check_start_tree cvswork &&
407 check_file cvswork textfile.c v1 &&
408 check_file cvswork t2 v1 &&
@@ -418,8 +415,7 @@ test_expect_success 'cvs up (check CVS/Tag files)' '
415
416 # This is not really legal CVS, but it seems to work anyway:
417 test_expect_success 'cvs up -r heads/b1' '
421 - ( cd cvswork &&
422 - cvs -f up -r heads/b1 ) >cvs.log 2>&1 &&
418 + ( cd cvswork && cvs -f up -r heads/b1 ) >cvs.log 2>&1 &&
419 check_start_tree cvswork &&
420 check_file cvswork textfile.c v1.2 &&
421 check_file cvswork t3 v1.2 &&
@@ -433,8 +429,7 @@ test_expect_success 'cvs up -r heads/b1' '
429
430 # But this should work even if CVS client checks -r more carefully:
431 test_expect_success 'cvs up -r heads_-s-b2 (cvsserver escape mechanism)' '
436 - ( cd cvswork &&
437 - cvs -f up -r heads_-s-b2 ) >cvs.log 2>&1 &&
432 + ( cd cvswork && cvs -f up -r heads_-s-b2 ) >cvs.log 2>&1 &&
433 check_start_tree cvswork &&
434 check_file cvswork textfile.c v2 &&
435 check_file cvswork adir/afile v2 &&
@@ -447,8 +442,7 @@ test_expect_success 'cvs up -r heads_-s-b2 (cvsserver escape mechanism)' '
442 v1hash=$(git rev-parse v1)
443 test_expect_success 'cvs up -r $(git rev-parse v1)' '
444 test -n "$v1hash" &&
450 - ( cd cvswork &&
451 - cvs -f up -r "$v1hash" ) >cvs.log 2>&1 &&
445 + ( cd cvswork && cvs -f up -r "$v1hash" ) >cvs.log 2>&1 &&
446 check_start_tree cvswork &&
447 check_file cvswork textfile.c v1 &&
448 check_file cvswork t2 v1 &&
@@ -460,23 +454,20 @@ test_expect_success 'cvs up -r $(git rev-parse v1)' '
454 '
455
456 test_expect_success 'cvs diff -r v1 -u' '
463 - ( cd cvswork &&
464 - cvs -f diff -r v1 -u ) >cvsDiff.out 2>cvs.log &&
457 + ( cd cvswork && cvs -f diff -r v1 -u ) >cvsDiff.out 2>cvs.log &&
458 test ! -s cvsDiff.out &&
459 test ! -s cvs.log
460 '
461
462 test_expect_success 'cvs diff -N -r v2 -u' '
470 - ( cd cvswork &&
471 - ! cvs -f diff -N -r v2 -u ) >cvsDiff.out 2>cvs.log &&
463 + ( cd cvswork && ! cvs -f diff -N -r v2 -u ) >cvsDiff.out 2>cvs.log &&
464 test ! -s cvs.log &&
465 test -s cvsDiff.out &&
466 check_diff cvsDiff.out v2 v1 >check_diff.out 2>&1
467 '
468
469 test_expect_success 'cvs diff -N -r v2 -r v1.2' '
478 - ( cd cvswork &&
479 - ! cvs -f diff -N -r v2 -r v1.2 -u ) >cvsDiff.out 2>cvs.log &&
470 + ( cd cvswork && ! cvs -f diff -N -r v2 -r v1.2 -u ) >cvsDiff.out 2>cvs.log &&
471 test ! -s cvs.log &&
472 test -s cvsDiff.out &&
473 check_diff cvsDiff.out v2 v1.2 >check_diff.out 2>&1
@@ -484,17 +475,18 @@ test_expect_success 'cvs diff -N -r v2 -r v1.2' '
475
476 test_expect_success 'apply early [cvswork3] diff to b3' '
477 git clone -q . gitwork3 &&
487 - ( cd gitwork3 &&
478 + (
479 + cd gitwork3 &&
480 git checkout -b b3 v1 &&
481 git apply -p0 --index <"$WORKDIR/cvswork3edit.diff" &&
490 - git commit -m "cvswork3 edits applied" ) &&
482 + git commit -m "cvswork3 edits applied"
483 + ) &&
484 git fetch gitwork3 b3:b3 &&
485 git tag v3 b3
486 '
487
488 test_expect_success 'check [cvswork3] diff' '
496 - ( cd cvswork3 &&
497 - ! cvs -f diff -N -u ) >"$WORKDIR/cvsDiff.out" 2>cvs.log &&
489 + ( cd cvswork3 && ! cvs -f diff -N -u ) >"$WORKDIR/cvsDiff.out" 2>cvs.log &&
490 test ! -s cvs.log &&
491 test -s cvsDiff.out &&
492 test $(grep Index: cvsDiff.out | wc -l) = 3 &&
@@ -503,8 +495,7 @@ test_expect_success 'check [cvswork3] diff' '
495 '
496
497 test_expect_success 'merge early [cvswork3] b3 with b1' '
506 - ( cd gitwork3 &&
507 - git merge "message" HEAD b1 )
498 + ( cd gitwork3 && git merge "message" HEAD b1 ) &&
499 git fetch gitwork3 b3:b3 &&
500 git tag v3merged b3 &&
501 git push --tags gitcvs.git b3:b3
@@ -515,11 +506,13 @@ test_expect_success 'merge early [cvswork3] b3 with b1' '
506 # TODO: Validate that the .# file was saved properly, and then
507 # delete/ignore it when checking the tree.
508 test_expect_success 'cvs up dirty [cvswork3]' '
518 - ( cd cvswork3 &&
509 + (
510 + cd cvswork3 &&
511 cvs -f up &&
520 - ! cvs -f diff -N -u >"$WORKDIR/cvsDiff.out" ) >cvs.log 2>&1 &&
512 + ! cvs -f diff -N -u >"$WORKDIR/cvsDiff.out"
513 + ) >cvs.log 2>&1 &&
514 test -s cvsDiff.out &&
522 - test $(grep Index: cvsDiff.out | wc -l) = 2
515 + test $(grep Index: cvsDiff.out | wc -l) = 2 &&
516 check_start_tree cvswork3 &&
517 check_file cvswork3 textfile.c v3merged &&
518 check_file cvswork3 t3 v3merged &&
@@ -534,8 +527,9 @@ test_expect_success 'cvs up dirty [cvswork3]' '
527
528 # TODO: test cvs status
529
537 -test_expect_success 'cvs commit [cvswork3' '
538 - ( cd cvswork3 &&
530 +test_expect_success 'cvs commit [cvswork3]' '
531 + (
532 + cd cvswork3 &&
533 cvs -f commit -m "dirty sandbox after auto-merge"
534 ) >cvs.log 2>&1 &&
535 check_start_tree cvswork3 &&