{"thread":{"id":"32298","subject":"[PATCH 5/8] t9402: Add missing &&; Code style","startedAt":"2012-12-08T21:34:55Z","lastAt":"2012-12-08T21:34:55Z","messageCount":1,"participants":["Torsten Bögershausen"],"isPatch":true,"patchVersion":1,"patchTotal":8},"messages":[{"id":"204613","messageId":"201212082234.55979.tboegi@web.de","threadId":"32298","inReplyTo":null,"subject":"[PATCH 5/8] t9402: Add missing &&; Code style","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2012-12-08T21:34:55Z","receivedAt":"2012-12-08T21:34:55Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"Add missing && at 2 places\nRe-formated the sub-shell parantheses (coding style)\nAdded missing ] in the test_expect_success header at 2 places\n\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\n t/t9402-git-cvsserver-refs.sh | 110 ++++++++++++++++++++----------------------\n 1 file changed, 52 insertions(+), 58 deletions(-)\n\ndiff --git a/t/t9402-git-cvsserver-refs.sh b/t/t9402-git-cvsserver-refs.sh\nindex 2f63331..d525778 100755\n--- a/t/t9402-git-cvsserver-refs.sh\n+++ b/t/t9402-git-cvsserver-refs.sh\n@@ -54,10 +54,12 @@ check_diff() {\n     vNew=\"$3\"\n     rm -rf diffSandbox\n     git clone -q -n . diffSandbox &&\n-    ( cd diffSandbox &&\n+    (\n+      cd diffSandbox &&\n       git checkout \"$vOld\" &&\n       git apply -p0 --index <\"../$diffFile\" &&\n-      git diff --exit-code \"$vNew\" ) >check_diff_apply.out 2>&1\n+      git diff --exit-code \"$vNew\"\n+\t\t) >check_diff_apply.out 2>&1\n }\n \n #########\n@@ -149,7 +151,8 @@ test_expect_success 'cvs co b1 [cvswork3]' '\n '\n \n test_expect_success 'edit cvswork3 and save diff' '\n-    ( cd cvswork3 &&\n+    (\n+      cd cvswork3 &&\n       sed -e \"s/line1/line1 - data/\" adir/afile >adir/afileNEW &&\n \t\t\tmv -f adir/afileNEW adir/afile &&\n       echo \"afile5\" >adir/afile5 &&\n@@ -180,8 +183,7 @@ test_expect_success 'setup v1.2 on b1' '\n '\n \n test_expect_success 'cvs -f up (on b1 adir)' '\n-    ( cd cvswork/adir &&\n-      cvs -f up -d ) >cvs.log 2>&1 &&\n+    ( cd cvswork/adir && cvs -f up -d ) >cvs.log 2>&1 &&\n     check_start_tree cvswork &&\n     check_file cvswork textfile.c v1 &&\n     check_file cvswork t2 v1 &&\n@@ -193,8 +195,7 @@ test_expect_success 'cvs -f up (on b1 adir)' '\n '\n \n test_expect_success 'cvs up (on b1 /)' '\n-    ( cd cvswork &&\n-      cvs -f up -d ) >cvs.log 2>&1 &&\n+    ( cd cvswork && cvs -f up -d ) >cvs.log 2>&1 &&\n     check_start_tree cvswork &&\n     check_file cvswork textfile.c v1.2 &&\n     check_file cvswork t3 v1.2 &&\n@@ -208,8 +209,7 @@ test_expect_success 'cvs up (on b1 /)' '\n \n # Make sure \"CVS/Tag\" files didn't get messed up:\n test_expect_success 'cvs up (on b1 /) (again; check CVS/Tag files)' '\n-    ( cd cvswork &&\n-      cvs -f up -d ) >cvs.log 2>&1 &&\n+    ( cd cvswork && cvs -f up -d ) >cvs.log 2>&1 &&\n     check_start_tree cvswork &&\n     check_file cvswork textfile.c v1.2 &&\n     check_file cvswork t3 v1.2 &&\n@@ -223,8 +223,7 @@ test_expect_success 'cvs up (on b1 /) (again; check CVS/Tag files)' '\n \n # update to another version:\n test_expect_success 'cvs up -r v1' '\n-    ( cd cvswork &&\n-      cvs -f up -r v1 ) >cvs.log 2>&1 &&\n+    ( cd cvswork && cvs -f up -r v1 ) >cvs.log 2>&1 &&\n     check_start_tree cvswork &&\n     check_file cvswork textfile.c v1 &&\n     check_file cvswork t2 v1 &&\n@@ -236,8 +235,7 @@ test_expect_success 'cvs up -r v1' '\n '\n \n test_expect_success 'cvs up' '\n-    ( cd cvswork &&\n-      cvs -f up ) >cvs.log 2>&1 &&\n+    ( cd cvswork && cvs -f up ) >cvs.log 2>&1 &&\n     check_start_tree cvswork &&\n     check_file cvswork textfile.c v1 &&\n     check_file cvswork t2 v1 &&\n@@ -249,8 +247,7 @@ test_expect_success 'cvs up' '\n '\n \n test_expect_success 'cvs up (again; check CVS/Tag files)' '\n-    ( cd cvswork &&\n-      cvs -f up -d ) >cvs.log 2>&1 &&\n+    ( cd cvswork && cvs -f up -d ) >cvs.log 2>&1 &&\n     check_start_tree cvswork &&\n     check_file cvswork textfile.c v1 &&\n     check_file cvswork t2 v1 &&\n@@ -279,15 +276,16 @@ test_expect_success 'cvs co b2 [into cvswork2]' '\n '\n \n test_expect_success 'root dir edit [cvswork2]' '\n-    ( cd cvswork2 &&\n-      echo \"Line 2\" >>textfile.c &&\n+    (\n+      cd cvswork2 && echo \"Line 2\" >>textfile.c &&\n       ! cvs -f diff -u >\"$WORKDIR/cvsEdit1.diff\" &&\n       cvs -f commit -m \"edit textfile.c\" textfile.c\n     ) >cvsEdit1.log 2>&1\n '\n \n test_expect_success 'root dir rm file [cvswork2]' '\n-    ( cd cvswork2 &&\n+    (\n+      cd cvswork2 &&\n       cvs -f rm -f t2 &&\n       cvs -f diff -u >../cvsEdit2-empty.diff &&\n       ! cvs -f diff -N -u >\"$WORKDIR/cvsEdit2-N.diff\" &&\n@@ -295,8 +293,9 @@ test_expect_success 'root dir rm file [cvswork2]' '\n     ) >cvsEdit2.log 2>&1\n '\n \n-test_expect_success 'subdir edit/add/rm files [cvswork2' '\n-    ( cd cvswork2 &&\n+test_expect_success 'subdir edit/add/rm files [cvswork2]' '\n+    (\n+      cd cvswork2 &&\n       sed -e \"s/line 1/line 1 (v2)/\" adir/bdir/bfile >adir/bdir/bfileNEW &&\n       mv -f adir/bdir/bfileNEW adir/bdir/bfile &&\n       rm adir/bdir/b2file &&\n@@ -306,9 +305,10 @@ test_expect_success 'subdir edit/add/rm files [cvswork2' '\n       cvs -f add bdir/b4file &&\n       ! cvs -f diff -N -u >\"$WORKDIR/cvsEdit3.diff\" &&\n       git fetch gitcvs.git b2:b2 &&\n-      ( cd .. &&\n-\t! cvs -f diff -u -N -r v1.2 >\"$WORKDIR/cvsEdit3-v1.2.diff\" &&\n-\t! cvs -f diff -u -N -r v1.2 -r v1 >\"$WORKDIR/cvsEdit3-v1.2-v1.diff\"\n+      (\n+        cd .. &&\n+        ! cvs -f diff -u -N -r v1.2 >\"$WORKDIR/cvsEdit3-v1.2.diff\" &&\n+        ! cvs -f diff -u -N -r v1.2 -r v1 >\"$WORKDIR/cvsEdit3-v1.2-v1.diff\"\n       ) &&\n       cvs -f commit -m \"various add/rm/edit\"\n     ) >cvs.log 2>&1\n@@ -334,12 +334,14 @@ test_expect_success 'validate basic diffs saved during above cvswork2 edits' '\n     test $(grep Index: cvsEdit3.diff | wc -l) = 3 &&\n     rm -rf diffSandbox &&\n     git clone -q -n . diffSandbox &&\n-    ( cd diffSandbox &&\n+    (\n+      cd diffSandbox &&\n       git checkout v1 &&\n       git apply -p0 --index <\"$WORKDIR/cvsEdit1.diff\" &&\n       git apply -p0 --index <\"$WORKDIR/cvsEdit2-N.diff\" &&\n       git apply -p0 --directory=adir --index <\"$WORKDIR/cvsEdit3.diff\" &&\n-      git diff --exit-code v2 ) >\"check_diff_apply.out\" 2>&1\n+      git diff --exit-code v2\n+    ) >\"check_diff_apply.out\" 2>&1\n '\n \n test_expect_success 'validate v1.2 diff saved during last cvswork2 edit' '\n@@ -353,8 +355,7 @@ test_expect_success 'validate v1.2 v1 diff saved during last cvswork2 edit' '\n '\n \n test_expect_success 'cvs up [cvswork2]' '\n-    ( cd cvswork2 &&\n-      cvs -f up ) >cvs.log 2>&1 &&\n+    ( cd cvswork2 && cvs -f up ) >cvs.log 2>&1 &&\n     check_start_tree cvswork2 &&\n     check_file cvswork2 textfile.c v2 &&\n     check_file cvswork2 adir/afile v2 &&\n@@ -365,8 +366,7 @@ test_expect_success 'cvs up [cvswork2]' '\n '\n \n test_expect_success 'cvs up -r b2 [back to cvswork]' '\n-    ( cd cvswork &&\n-      cvs -f up -r b2 ) >cvs.log 2>&1 &&\n+    ( cd cvswork && cvs -f up -r b2 ) >cvs.log 2>&1 &&\n     check_start_tree cvswork &&\n     check_file cvswork textfile.c v2 &&\n     check_file cvswork adir/afile v2 &&\n@@ -377,8 +377,7 @@ test_expect_success 'cvs up -r b2 [back to cvswork]' '\n '\n \n test_expect_success 'cvs up -r b1' '\n-    ( cd cvswork &&\n-      cvs -f up -r b1 ) >cvs.log 2>&1 &&\n+    ( cd cvswork && cvs -f up -r b1 ) >cvs.log 2>&1 &&\n     check_start_tree cvswork &&\n     check_file cvswork textfile.c v1.2 &&\n     check_file cvswork t3 v1.2 &&\n@@ -391,8 +390,7 @@ test_expect_success 'cvs up -r b1' '\n '\n \n test_expect_success 'cvs up -A' '\n-    ( cd cvswork &&\n-      cvs -f up -A ) >cvs.log 2>&1 &&\n+    ( cd cvswork && cvs -f up -A ) >cvs.log 2>&1 &&\n     check_start_tree cvswork &&\n     check_file cvswork textfile.c v1 &&\n     check_file cvswork t2 v1 &&\n@@ -404,8 +402,7 @@ test_expect_success 'cvs up -A' '\n '\n \n test_expect_success 'cvs up (check CVS/Tag files)' '\n-    ( cd cvswork &&\n-      cvs -f up ) >cvs.log 2>&1 &&\n+    ( cd cvswork && cvs -f up ) >cvs.log 2>&1 &&\n     check_start_tree cvswork &&\n     check_file cvswork textfile.c v1 &&\n     check_file cvswork t2 v1 &&\n@@ -418,8 +415,7 @@ test_expect_success 'cvs up (check CVS/Tag files)' '\n \n # This is not really legal CVS, but it seems to work anyway:\n test_expect_success 'cvs up -r heads/b1' '\n-    ( cd cvswork &&\n-      cvs -f up -r heads/b1 ) >cvs.log 2>&1 &&\n+    ( cd cvswork && cvs -f up -r heads/b1 ) >cvs.log 2>&1 &&\n     check_start_tree cvswork &&\n     check_file cvswork textfile.c v1.2 &&\n     check_file cvswork t3 v1.2 &&\n@@ -433,8 +429,7 @@ test_expect_success 'cvs up -r heads/b1' '\n \n # But this should work even if CVS client checks -r more carefully:\n test_expect_success 'cvs up -r heads_-s-b2 (cvsserver escape mechanism)' '\n-    ( cd cvswork &&\n-      cvs -f up -r heads_-s-b2 ) >cvs.log 2>&1 &&\n+    ( cd cvswork && cvs -f up -r heads_-s-b2 ) >cvs.log 2>&1 &&\n     check_start_tree cvswork &&\n     check_file cvswork textfile.c v2 &&\n     check_file cvswork adir/afile v2 &&\n@@ -447,8 +442,7 @@ test_expect_success 'cvs up -r heads_-s-b2 (cvsserver escape mechanism)' '\n v1hash=$(git rev-parse v1)\n test_expect_success 'cvs up -r $(git rev-parse v1)' '\n     test -n \"$v1hash\" &&\n-    ( cd cvswork &&\n-      cvs -f up -r \"$v1hash\" ) >cvs.log 2>&1 &&\n+    ( cd cvswork && cvs -f up -r \"$v1hash\" ) >cvs.log 2>&1 &&\n     check_start_tree cvswork &&\n     check_file cvswork textfile.c v1 &&\n     check_file cvswork t2 v1 &&\n@@ -460,23 +454,20 @@ test_expect_success 'cvs up -r $(git rev-parse v1)' '\n '\n \n test_expect_success 'cvs diff -r v1 -u' '\n-    ( cd cvswork &&\n-      cvs -f diff -r v1 -u ) >cvsDiff.out 2>cvs.log &&\n+    ( cd cvswork && cvs -f diff -r v1 -u ) >cvsDiff.out 2>cvs.log &&\n     test ! -s cvsDiff.out &&\n     test ! -s cvs.log\n '\n \n test_expect_success 'cvs diff -N -r v2 -u' '\n-    ( cd cvswork &&\n-      ! cvs -f diff -N -r v2 -u ) >cvsDiff.out 2>cvs.log &&\n+    ( cd cvswork && ! cvs -f diff -N -r v2 -u ) >cvsDiff.out 2>cvs.log &&\n     test ! -s cvs.log &&\n     test -s cvsDiff.out &&\n     check_diff cvsDiff.out v2 v1 >check_diff.out 2>&1\n '\n \n test_expect_success 'cvs diff -N -r v2 -r v1.2' '\n-    ( cd cvswork &&\n-      ! cvs -f diff -N -r v2 -r v1.2 -u ) >cvsDiff.out 2>cvs.log &&\n+    ( cd cvswork && ! cvs -f diff -N -r v2 -r v1.2 -u ) >cvsDiff.out 2>cvs.log &&\n     test ! -s cvs.log &&\n     test -s cvsDiff.out &&\n     check_diff cvsDiff.out v2 v1.2 >check_diff.out 2>&1\n@@ -484,17 +475,18 @@ test_expect_success 'cvs diff -N -r v2 -r v1.2' '\n \n test_expect_success 'apply early [cvswork3] diff to b3' '\n     git clone -q . gitwork3 &&\n-    ( cd gitwork3 &&\n+    (\n+      cd gitwork3 &&\n       git checkout -b b3 v1 &&\n       git apply -p0 --index <\"$WORKDIR/cvswork3edit.diff\" &&\n-      git commit -m \"cvswork3 edits applied\" ) &&\n+      git commit -m \"cvswork3 edits applied\"\n+    ) &&\n     git fetch gitwork3 b3:b3 &&\n     git tag v3 b3\n '\n \n test_expect_success 'check [cvswork3] diff' '\n-    ( cd cvswork3 &&\n-      ! cvs -f diff -N -u ) >\"$WORKDIR/cvsDiff.out\" 2>cvs.log &&\n+    ( cd cvswork3 && ! cvs -f diff -N -u ) >\"$WORKDIR/cvsDiff.out\" 2>cvs.log &&\n     test ! -s cvs.log &&\n     test -s cvsDiff.out &&\n     test $(grep Index: cvsDiff.out | wc -l) = 3 &&\n@@ -503,8 +495,7 @@ test_expect_success 'check [cvswork3] diff' '\n '\n \n test_expect_success 'merge early [cvswork3] b3 with b1' '\n-    ( cd gitwork3 &&\n-      git merge \"message\" HEAD b1 )\n+    ( cd gitwork3 && git merge \"message\" HEAD b1 ) &&\n     git fetch gitwork3 b3:b3 &&\n     git tag v3merged b3 &&\n     git push --tags gitcvs.git b3:b3\n@@ -515,11 +506,13 @@ test_expect_success 'merge early [cvswork3] b3 with b1' '\n # TODO: Validate that the .# file was saved properly, and then\n #   delete/ignore it when checking the tree.\n test_expect_success 'cvs up dirty [cvswork3]' '\n-    ( cd cvswork3 &&\n+    (\n+      cd cvswork3 &&\n       cvs -f up &&\n-      ! cvs -f diff -N -u >\"$WORKDIR/cvsDiff.out\" ) >cvs.log 2>&1 &&\n+      ! cvs -f diff -N -u >\"$WORKDIR/cvsDiff.out\"\n+    ) >cvs.log 2>&1 &&\n     test -s cvsDiff.out &&\n-    test $(grep Index: cvsDiff.out | wc -l) = 2\n+    test $(grep Index: cvsDiff.out | wc -l) = 2 &&\n     check_start_tree cvswork3 &&\n     check_file cvswork3 textfile.c v3merged &&\n     check_file cvswork3 t3 v3merged &&\n@@ -534,8 +527,9 @@ test_expect_success 'cvs up dirty [cvswork3]' '\n \n # TODO: test cvs status\n \n-test_expect_success 'cvs commit [cvswork3' '\n-    ( cd cvswork3 &&\n+test_expect_success 'cvs commit [cvswork3]' '\n+    (\n+      cd cvswork3 &&\n       cvs -f commit -m \"dirty sandbox after auto-merge\"\n     ) >cvs.log 2>&1 &&\n     check_start_tree cvswork3 &&\n-- \n1.8.0.197.g5a90748\n"}]}