@@ -54,10 +54,12 @@ check_diff() {
5454 vNew=" $3 "
5555 rm -rf diffSandbox
5656 git clone -q -n . diffSandbox &&
57- ( cd diffSandbox &&
57+ (
58+ cd diffSandbox &&
5859 git checkout " $vOld " &&
5960 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
6163}
6264
6365# ########
@@ -149,7 +151,8 @@ test_expect_success 'cvs co b1 [cvswork3]' '
149151'
150152
151153test_expect_success ' edit cvswork3 and save diff' '
152- ( cd cvswork3 &&
154+ (
155+ cd cvswork3 &&
153156 sed -e "s/line1/line1 - data/" adir/afile >adir/afileNEW &&
154157 mv -f adir/afileNEW adir/afile &&
155158 echo "afile5" >adir/afile5 &&
@@ -180,8 +183,7 @@ test_expect_success 'setup v1.2 on b1' '
180183'
181184
182185test_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 &&
185187 check_start_tree cvswork &&
186188 check_file cvswork textfile.c v1 &&
187189 check_file cvswork t2 v1 &&
@@ -193,8 +195,7 @@ test_expect_success 'cvs -f up (on b1 adir)' '
193195'
194196
195197test_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 &&
198199 check_start_tree cvswork &&
199200 check_file cvswork textfile.c v1.2 &&
200201 check_file cvswork t3 v1.2 &&
@@ -208,8 +209,7 @@ test_expect_success 'cvs up (on b1 /)' '
208209
209210# Make sure "CVS/Tag" files didn't get messed up:
210211test_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 &&
213213 check_start_tree cvswork &&
214214 check_file cvswork textfile.c v1.2 &&
215215 check_file cvswork t3 v1.2 &&
@@ -223,8 +223,7 @@ test_expect_success 'cvs up (on b1 /) (again; check CVS/Tag files)' '
223223
224224# update to another version:
225225test_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 &&
228227 check_start_tree cvswork &&
229228 check_file cvswork textfile.c v1 &&
230229 check_file cvswork t2 v1 &&
@@ -236,8 +235,7 @@ test_expect_success 'cvs up -r v1' '
236235'
237236
238237test_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 &&
241239 check_start_tree cvswork &&
242240 check_file cvswork textfile.c v1 &&
243241 check_file cvswork t2 v1 &&
@@ -249,8 +247,7 @@ test_expect_success 'cvs up' '
249247'
250248
251249test_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 &&
254251 check_start_tree cvswork &&
255252 check_file cvswork textfile.c v1 &&
256253 check_file cvswork t2 v1 &&
@@ -279,24 +276,26 @@ test_expect_success 'cvs co b2 [into cvswork2]' '
279276'
280277
281278test_expect_success ' root dir edit [cvswork2]' '
282- ( cd cvswork2 &&
283- echo "Line 2" >>textfile.c &&
279+ (
280+ cd cvswork2 && echo "Line 2" >>textfile.c &&
284281 ! cvs -f diff -u >"$WORKDIR/cvsEdit1.diff" &&
285282 cvs -f commit -m "edit textfile.c" textfile.c
286283 ) >cvsEdit1.log 2>&1
287284'
288285
289286test_expect_success ' root dir rm file [cvswork2]' '
290- ( cd cvswork2 &&
287+ (
288+ cd cvswork2 &&
291289 cvs -f rm -f t2 &&
292290 cvs -f diff -u >../cvsEdit2-empty.diff &&
293291 ! cvs -f diff -N -u >"$WORKDIR/cvsEdit2-N.diff" &&
294292 cvs -f commit -m "rm t2"
295293 ) >cvsEdit2.log 2>&1
296294'
297295
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 &&
300299 sed -e "s/line 1/line 1 (v2)/" adir/bdir/bfile >adir/bdir/bfileNEW &&
301300 mv -f adir/bdir/bfileNEW adir/bdir/bfile &&
302301 rm adir/bdir/b2file &&
@@ -306,7 +305,8 @@ test_expect_success 'subdir edit/add/rm files [cvswork2' '
306305 cvs -f add bdir/b4file &&
307306 ! cvs -f diff -N -u >"$WORKDIR/cvsEdit3.diff" &&
308307 git fetch gitcvs.git b2:b2 &&
309- ( cd .. &&
308+ (
309+ cd .. &&
310310 ! cvs -f diff -u -N -r v1.2 >"$WORKDIR/cvsEdit3-v1.2.diff" &&
311311 ! cvs -f diff -u -N -r v1.2 -r v1 >"$WORKDIR/cvsEdit3-v1.2-v1.diff"
312312 ) &&
@@ -334,12 +334,14 @@ test_expect_success 'validate basic diffs saved during above cvswork2 edits' '
334334 test $(grep Index: cvsEdit3.diff | wc -l) = 3 &&
335335 rm -rf diffSandbox &&
336336 git clone -q -n . diffSandbox &&
337- ( cd diffSandbox &&
337+ (
338+ cd diffSandbox &&
338339 git checkout v1 &&
339340 git apply -p0 --index <"$WORKDIR/cvsEdit1.diff" &&
340341 git apply -p0 --index <"$WORKDIR/cvsEdit2-N.diff" &&
341342 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
343345'
344346
345347test_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' '
353355'
354356
355357test_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 &&
358359 check_start_tree cvswork2 &&
359360 check_file cvswork2 textfile.c v2 &&
360361 check_file cvswork2 adir/afile v2 &&
@@ -365,8 +366,7 @@ test_expect_success 'cvs up [cvswork2]' '
365366'
366367
367368test_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 &&
370370 check_start_tree cvswork &&
371371 check_file cvswork textfile.c v2 &&
372372 check_file cvswork adir/afile v2 &&
@@ -377,8 +377,7 @@ test_expect_success 'cvs up -r b2 [back to cvswork]' '
377377'
378378
379379test_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 &&
382381 check_start_tree cvswork &&
383382 check_file cvswork textfile.c v1.2 &&
384383 check_file cvswork t3 v1.2 &&
@@ -391,8 +390,7 @@ test_expect_success 'cvs up -r b1' '
391390'
392391
393392test_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 &&
396394 check_start_tree cvswork &&
397395 check_file cvswork textfile.c v1 &&
398396 check_file cvswork t2 v1 &&
@@ -404,8 +402,7 @@ test_expect_success 'cvs up -A' '
404402'
405403
406404test_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 &&
409406 check_start_tree cvswork &&
410407 check_file cvswork textfile.c v1 &&
411408 check_file cvswork t2 v1 &&
@@ -418,8 +415,7 @@ test_expect_success 'cvs up (check CVS/Tag files)' '
418415
419416# This is not really legal CVS, but it seems to work anyway:
420417test_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 &&
423419 check_start_tree cvswork &&
424420 check_file cvswork textfile.c v1.2 &&
425421 check_file cvswork t3 v1.2 &&
@@ -433,8 +429,7 @@ test_expect_success 'cvs up -r heads/b1' '
433429
434430# But this should work even if CVS client checks -r more carefully:
435431test_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 &&
438433 check_start_tree cvswork &&
439434 check_file cvswork textfile.c v2 &&
440435 check_file cvswork adir/afile v2 &&
@@ -447,8 +442,7 @@ test_expect_success 'cvs up -r heads_-s-b2 (cvsserver escape mechanism)' '
447442v1hash=$( git rev-parse v1)
448443test_expect_success ' cvs up -r $(git rev-parse v1)' '
449444 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 &&
452446 check_start_tree cvswork &&
453447 check_file cvswork textfile.c v1 &&
454448 check_file cvswork t2 v1 &&
@@ -460,41 +454,39 @@ test_expect_success 'cvs up -r $(git rev-parse v1)' '
460454'
461455
462456test_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 &&
465458 test ! -s cvsDiff.out &&
466459 test ! -s cvs.log
467460'
468461
469462test_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 &&
472464 test ! -s cvs.log &&
473465 test -s cvsDiff.out &&
474466 check_diff cvsDiff.out v2 v1 >check_diff.out 2>&1
475467'
476468
477469test_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 &&
480471 test ! -s cvs.log &&
481472 test -s cvsDiff.out &&
482473 check_diff cvsDiff.out v2 v1.2 >check_diff.out 2>&1
483474'
484475
485476test_expect_success ' apply early [cvswork3] diff to b3' '
486477 git clone -q . gitwork3 &&
487- ( cd gitwork3 &&
478+ (
479+ cd gitwork3 &&
488480 git checkout -b b3 v1 &&
489481 git apply -p0 --index <"$WORKDIR/cvswork3edit.diff" &&
490- git commit -m "cvswork3 edits applied" ) &&
482+ git commit -m "cvswork3 edits applied"
483+ ) &&
491484 git fetch gitwork3 b3:b3 &&
492485 git tag v3 b3
493486'
494487
495488test_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 &&
498490 test ! -s cvs.log &&
499491 test -s cvsDiff.out &&
500492 test $(grep Index: cvsDiff.out | wc -l) = 3 &&
@@ -503,8 +495,7 @@ test_expect_success 'check [cvswork3] diff' '
503495'
504496
505497test_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 ) &&
508499 git fetch gitwork3 b3:b3 &&
509500 git tag v3merged b3 &&
510501 git push --tags gitcvs.git b3:b3
@@ -515,11 +506,13 @@ test_expect_success 'merge early [cvswork3] b3 with b1' '
515506# TODO: Validate that the .# file was saved properly, and then
516507# delete/ignore it when checking the tree.
517508test_expect_success ' cvs up dirty [cvswork3]' '
518- ( cd cvswork3 &&
509+ (
510+ cd cvswork3 &&
519511 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 &&
521514 test -s cvsDiff.out &&
522- test $(grep Index: cvsDiff.out | wc -l) = 2
515+ test $(grep Index: cvsDiff.out | wc -l) = 2 &&
523516 check_start_tree cvswork3 &&
524517 check_file cvswork3 textfile.c v3merged &&
525518 check_file cvswork3 t3 v3merged &&
@@ -534,8 +527,9 @@ test_expect_success 'cvs up dirty [cvswork3]' '
534527
535528# TODO: test cvs status
536529
537- test_expect_success ' cvs commit [cvswork3' '
538- ( cd cvswork3 &&
530+ test_expect_success ' cvs commit [cvswork3]' '
531+ (
532+ cd cvswork3 &&
539533 cvs -f commit -m "dirty sandbox after auto-merge"
540534 ) >cvs.log 2>&1 &&
541535 check_start_tree cvswork3 &&
0 commit comments