{"thread":{"id":"25321","subject":"[PATCHv6 02/16] t3020 (ls-files-error-unmatch): remove stray '1' from end of file","startedAt":"2010-10-03T19:59:58Z","lastAt":"2010-11-17T23:12:20Z","messageCount":62,"participants":["Elijah Newren","Jonathan Nieder","Junio C Hamano","Ævar Arnfjörð Bjarmason","Matthieu Moy","Johannes Sixt","Sverre Rabbelier","yj2133011"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"152386","messageId":"1286136014-7728-1-git-send-email-newren@gmail.com","threadId":"25321","inReplyTo":null,"subject":"[PATCHv6 00/16] Add missing &&'s in the testsuite","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T19:59:58Z","receivedAt":"2010-10-03T19:59:58Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"This patch series fixes many of the missing &&s in the testsuite.\nThanks to Junio, Jonathan, and Ævar for lots of time reviewing and\nmaking suggestions so far.\n\nChanges since v5:\n  * Made changes suggested by Jonathan on v4.  Notable items remaining:\n    * In patch 1, I made two of the changes suggested by Jonathan, but\n      this was Ævar's patch so he may want to comment on those.  Also,\n      Jonathan had a few extra questions in the last round that\n      perhaps Ævar may want to comment on.\n    * In patch 7 (t3600), there's still an outstanding question about\n      what and how to change it.\n    * In patch 15, (the t1509 test), Jonathan pointed out a potential\n      problem, and I'm unsure whether the change I made is what is\n      wanted.\n\nElijah Newren (15):\n  t3020 (ls-files-error-unmatch): remove stray '1' from end of file\n  t4017 (diff-retval): replace manual exit code check with\n    test_expect_code\n  t100[12] (read-tree-m-2way, read_tree_m_u_2way): add missing &&\n  t4002 (diff-basic): use test_might_fail for commands that might fail\n  t4202 (log): Replace '<git-command> || :' with test_might_fail\n  t3600 (rm): add lots of missing &&\n  t4019 (diff-wserror): add lots of missing &&\n  t4026 (color): remove unneeded and unchained command\n  t5602 (clone-remote-exec): add missing &&\n  t6016 (rev-list-graph-simplify-history): add missing &&\n  t7001 (mv): add missing &&\n  t7601 (merge-pull-config): add missing &&\n  t7800 (difftool): add missing &&\n  Add missing &&'s throughout the testsuite\n  Introduce portable_unset and use it to ensure proper && chaining\n\nÆvar Arnfjörð Bjarmason (1):\n  test-lib: make test_expect_code a test command\n\n t/README                                    |   29 +++++------\n t/t0000-basic.sh                            |   55 +++++++++++++++++----\n t/t0001-init.sh                             |   30 ++++++------\n t/t0003-attributes.sh                       |   45 ++++++++---------\n t/t0020-crlf.sh                             |    2 +-\n t/t0024-crlf-archive.sh                     |    4 +-\n t/t0026-eol-config.sh                       |    2 +-\n t/t0050-filesystem.sh                       |    6 +-\n t/t1000-read-tree-m-3way.sh                 |    2 +-\n t/t1001-read-tree-m-2way.sh                 |   18 ++++----\n t/t1002-read-tree-m-u-2way.sh               |   10 ++--\n t/t1302-repo-version.sh                     |    2 +-\n t/t1401-symbolic-ref.sh                     |    2 +-\n t/t1402-check-ref-format.sh                 |    4 +-\n t/t1410-reflog.sh                           |    8 ++--\n t/t1501-worktree.sh                         |    2 +-\n t/t1504-ceiling-dirs.sh                     |    5 +-\n t/t1509-root-worktree.sh                    |    5 +-\n t/t2007-checkout-symlink.sh                 |    2 +-\n t/t2016-checkout-patch.sh                   |    2 +-\n t/t2050-git-dir-relative.sh                 |    4 +-\n t/t2103-update-index-ignore-missing.sh      |    2 +-\n t/t2200-add-update.sh                       |    2 +-\n t/t3001-ls-files-others-exclude.sh          |    2 +-\n t/t3020-ls-files-error-unmatch.sh           |    1 -\n t/t3050-subprojects-fetch.sh                |    4 +-\n t/t3203-branch-output.sh                    |    6 +-\n t/t3307-notes-man.sh                        |    2 +-\n t/t3406-rebase-message.sh                   |    6 +-\n t/t3408-rebase-multi-line.sh                |    2 +-\n t/t3504-cherry-pick-rerere.sh               |    4 +-\n t/t3600-rm.sh                               |   38 +++++++--------\n t/t3903-stash.sh                            |    4 +-\n t/t3904-stash-patch.sh                      |    2 +-\n t/t4002-diff-basic.sh                       |   12 ++--\n t/t4017-diff-retval.sh                      |   69 ++++++++-------------------\n t/t4019-diff-wserror.sh                     |   53 ++++++++++----------\n t/t4021-format-patch-numbered.sh            |    2 +-\n t/t4026-color.sh                            |    1 -\n t/t4027-diff-submodule.sh                   |    2 +-\n t/t4103-apply-binary.sh                     |    8 ++--\n t/t4104-apply-boundary.sh                   |    4 +-\n t/t4111-apply-subdir.sh                     |    4 +-\n t/t4119-apply-config.sh                     |    2 +-\n t/t4124-apply-ws-rule.sh                    |    4 +-\n t/t4127-apply-same-fn.sh                    |   18 ++++----\n t/t4130-apply-criss-cross-rename.sh         |    2 +-\n t/t4133-apply-filenames.sh                  |    6 +-\n t/t4150-am.sh                               |    2 +-\n t/t4202-log.sh                              |    2 +-\n t/t5300-pack-object.sh                      |    4 +-\n t/t5301-sliding-window.sh                   |    2 +-\n t/t5302-pack-index.sh                       |    2 +-\n t/t5500-fetch-pack.sh                       |    2 +-\n t/t5502-quickfetch.sh                       |    2 +-\n t/t5503-tagfollow.sh                        |    4 +-\n t/t5510-fetch.sh                            |    2 +-\n t/t5516-fetch-push.sh                       |   20 ++++----\n t/t5517-push-mirror.sh                      |   10 ++--\n t/t5519-push-alternates.sh                  |    2 +-\n t/t5531-deep-submodule-push.sh              |    2 +-\n t/t5541-http-push.sh                        |    2 +-\n t/t5550-http-fetch.sh                       |    6 +--\n t/t5601-clone.sh                            |    6 +-\n t/t5602-clone-remote-exec.sh                |   22 ++++++---\n t/t5701-clone-local.sh                      |    8 ++--\n t/t5705-clone-2gb.sh                        |    2 +-\n t/t6009-rev-list-parent.sh                  |    2 +-\n t/t6010-merge-base.sh                       |    2 +-\n t/t6016-rev-list-graph-simplify-history.sh  |   29 ++++-------\n t/t6020-merge-df.sh                         |    4 +-\n t/t6022-merge-rename.sh                     |    2 +-\n t/t6024-recursive-merge.sh                  |    2 +-\n t/t6030-bisect-porcelain.sh                 |    8 ++--\n t/t6040-tracking-info.sh                    |    2 +-\n t/t7001-mv.sh                               |    2 +-\n t/t7004-tag.sh                              |   14 +++---\n t/t7006-pager.sh                            |   10 ++--\n t/t7105-reset-patch.sh                      |    6 +-\n t/t7300-clean.sh                            |    8 ++--\n t/t7501-commit.sh                           |    2 +-\n t/t7502-commit.sh                           |    6 +-\n t/t7506-status-submodule.sh                 |    2 +-\n t/t7600-merge.sh                            |    2 +-\n t/t7601-merge-pull-config.sh                |   12 ++--\n t/t7610-mergetool.sh                        |    2 +-\n t/t7700-repack.sh                           |    2 +-\n t/t7800-difftool.sh                         |   12 ++--\n t/t8003-blame.sh                            |    6 +-\n t/t9122-git-svn-author.sh                   |    4 +-\n t/t9123-git-svn-rebuild-with-rewriteroot.sh |    2 +-\n t/t9134-git-svn-ignore-paths.sh             |    6 +-\n t/t9137-git-svn-dcommit-clobber-series.sh   |    2 +-\n t/t9138-git-svn-authors-prog.sh             |    6 +-\n t/t9146-git-svn-empty-dirs.sh               |    6 +-\n t/t9151-svn-mergeinfo.sh                    |   22 ++++----\n t/t9200-git-cvsexportcommit.sh              |    4 +-\n t/t9401-git-cvsserver-crlf.sh               |    2 +-\n t/t9600-cvsimport.sh                        |    2 +-\n t/test-lib.sh                               |   51 +++++++++++++-------\n 100 files changed, 429 insertions(+), 418 deletions(-)\n\n-- \n1.7.3.1.66.gab790\n"},{"id":"152384","messageId":"1286136014-7728-2-git-send-email-newren@gmail.com","threadId":"25321","inReplyTo":"1286136014-7728-1-git-send-email-newren@gmail.com","subject":"[PATCHv6 01/16] test-lib: make test_expect_code a test command","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T19:59:59Z","receivedAt":"2010-10-03T19:59:59Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n\nChange test_expect_code to be a normal test command instead of a\ntop-level command.\n\nAs a top-level command it would fail in cases like:\n\n    test_expect_code 1 'phoney' '\n        foo && bar && (exit 1)\n    '\n\nHere the test might incorrectly succeed if \"foo\" or \"bar\" happened to\nfail with exit status 1. Instead we now do:\n\n    test_expect_success 'phoney' '\n        foo && bar && test_expect_code 1 \"(exit 1)\"\n    '\n\nWhich will only succeed if \"foo\" and \"bar\" return status 0, and \"(exit\n1)\" returns status 1.  Note that test_expect_code has been made slightly\nnoisier, as it reports the exit code it receives even upon success.\n\nSome test code in t0000-basic.sh relied on the old semantics of\ntest_expect_code to test the test_when_finished command. I've\nconverted that code to use an external test similar to the TODO test I\nadded in v1.7.3-rc0~2^2~3.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nAcked-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n t/README                |   16 +++++++------\n t/t0000-basic.sh        |   55 ++++++++++++++++++++++++++++++++++++++--------\n t/t1504-ceiling-dirs.sh |    5 ++-\n t/t6020-merge-df.sh     |    4 ++-\n t/test-lib.sh           |   40 ++++++++++++++++++---------------\n 5 files changed, 82 insertions(+), 38 deletions(-)\n\ndiff --git a/t/README b/t/README\nindex a1eb7c8..ee4c0cf 100644\n--- a/t/README\n+++ b/t/README\n@@ -395,13 +395,6 @@ library for your script to use.\n    Like test_expect_success this function can optionally use a three\n    argument invocation with a prerequisite as the first argument.\n \n- - test_expect_code [<prereq>] <code> <message> <script>\n-\n-   Analogous to test_expect_success, but pass the test if it exits\n-   with a given exit <code>\n-\n- test_expect_code 1 'Merge with d/f conflicts' 'git merge \"merge msg\" B master'\n-\n  - test_debug <script>\n \n    This takes a single argument, <script>, and evaluates it only\n@@ -482,6 +475,15 @@ library for your script to use.\n \t    'Perl API' \\\n \t    \"$PERL_PATH\" \"$TEST_DIRECTORY\"/t9700/test.pl\n \n+ - test_expect_code <exit-code> <command>\n+\n+   Run a command and ensure that it exits with the given exit code.\n+   For example:\n+\n+\ttest_expect_success 'Merge with d/f conflicts' '\n+\t\ttest_expect_code 1 git merge \"merge msg\" B master\n+\t'\n+\n  - test_must_fail <git-command>\n \n    Run a git command and ensure it fails in a controlled way.  Use\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex f688bd3..c2f5f8d 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -130,22 +130,57 @@ test_expect_success 'tests clean up after themselves' '\n     test_when_finished clean=yes\n '\n \n-cleaner=no\n-test_expect_code 1 'tests clean up even after a failure' '\n-    test_when_finished cleaner=yes &&\n-    (exit 1)\n-'\n-\n-if test $clean$cleaner != yesyes\n+if test $clean != yes\n then\n-\tsay \"bug in test framework: cleanup commands do not work reliably\"\n+\tsay \"bug in test framework: basic cleanup command does not work reliably\"\n \texit 1\n fi\n \n-test_expect_code 2 'failure to clean up causes the test to fail' '\n-    test_when_finished \"(exit 2)\"\n+test_expect_success 'tests clean up even on failures' \"\n+    mkdir failing-cleanup &&\n+    (cd failing-cleanup &&\n+    cat >failing-cleanup.sh <<EOF &&\n+#!$SHELL_PATH\n+\n+test_description='Failing tests with cleanup commands'\n+\n+# Point to the t/test-lib.sh, which isn't in ../ as usual\n+TEST_DIRECTORY=\\\"$TEST_DIRECTORY\\\"\n+. \\\"\\$TEST_DIRECTORY\\\"/test-lib.sh\n+\n+test_expect_success 'tests clean up even after a failure' '\n+    touch clean-after-failure &&\n+    test_when_finished rm clean-after-failure &&\n+    (exit 1)\n '\n \n+test_expect_success 'failure to clean up causes the test to fail' '\n+    test_when_finished \\\"(exit 2)\\\"\n+'\n+\n+test_done\n+EOF\n+    chmod +x failing-cleanup.sh &&\n+    test_must_fail ./failing-cleanup.sh >out 2>err &&\n+    ! test -s err &&\n+    ! test -f \\\"trash directory.failing-cleanup/clean-after-failure\\\" &&\n+cat >expect <<EOF &&\n+not ok - 1 tests clean up even after a failure\n+#\t\n+#\t    touch clean-after-failure &&\n+#\t    test_when_finished rm clean-after-failure &&\n+#\t    (exit 1)\n+#\t\n+not ok - 2 failure to clean up causes the test to fail\n+#\t\n+#\t    test_when_finished \\\"(exit 2)\\\"\n+#\t\n+# failed 2 among 2 test(s)\n+1..2\n+EOF\n+    test_cmp expect out)\n+\"\n+\n ################################################################\n # Basics of the basics\n \ndiff --git a/t/t1504-ceiling-dirs.sh b/t/t1504-ceiling-dirs.sh\nindex df5ad8c..cce87a5 100755\n--- a/t/t1504-ceiling-dirs.sh\n+++ b/t/t1504-ceiling-dirs.sh\n@@ -9,8 +9,9 @@ test_prefix() {\n }\n \n test_fail() {\n-\ttest_expect_code 128 \"$1: prefix\" \\\n-\t\"git rev-parse --show-prefix\"\n+\ttest_expect_success \"$1: prefix\" '\n+\t\ttest_expect_code 128 git rev-parse --show-prefix\n+\t'\n }\n \n TRASH_ROOT=\"$PWD\"\ndiff --git a/t/t6020-merge-df.sh b/t/t6020-merge-df.sh\nindex 490d397..5d91d05 100755\n--- a/t/t6020-merge-df.sh\n+++ b/t/t6020-merge-df.sh\n@@ -20,7 +20,9 @@ echo \"file dir\" > dir &&\n git add dir &&\n git commit -m \"File: dir\"'\n \n-test_expect_code 1 'Merge with d/f conflicts' 'git merge \"merge msg\" B master'\n+test_expect_success 'Merge with d/f conflicts' '\n+\ttest_expect_code 1 git merge \"merge msg\" B master\n+'\n \n test_expect_success 'F/D conflict' '\n \tgit reset --hard &&\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 830e5e7..d86edcd 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -473,24 +473,6 @@ test_expect_success () {\n \techo >&3 \"\"\n }\n \n-test_expect_code () {\n-\ttest \"$#\" = 4 && { prereq=$1; shift; } || prereq=\n-\ttest \"$#\" = 3 ||\n-\terror \"bug in the test script: not 3 or 4 parameters to test-expect-code\"\n-\tif ! test_skip \"$@\"\n-\tthen\n-\t\tsay >&3 \"expecting exit code $1: $3\"\n-\t\ttest_run_ \"$3\"\n-\t\tif [ \"$?\" = 0 -a \"$eval_ret\" = \"$1\" ]\n-\t\tthen\n-\t\t\ttest_ok_ \"$2\"\n-\t\telse\n-\t\t\ttest_failure_ \"$@\"\n-\t\tfi\n-\tfi\n-\techo >&3 \"\"\n-}\n-\n # test_external runs external test scripts that provide continuous\n # test output about their progress, and succeeds/fails on\n # zero/non-zero exit code.  It outputs the test output on stdout even\n@@ -658,6 +640,28 @@ test_might_fail () {\n \treturn 0\n }\n \n+# Similar to test_must_fail and test_might_fail, but check that a\n+# given command exited with a given exit code. Meant to be used as:\n+#\n+#\ttest_expect_success 'Merge with d/f conflicts' '\n+#\t\ttest_expect_code 1 git merge \"merge msg\" B master\n+#\t'\n+\n+test_expect_code () {\n+\twant_code=$1\n+\tshift\n+\t\"$@\"\n+\texit_code=$?\n+\tif test $exit_code = $want_code\n+\tthen\n+\t\techo >&2 \"test_expect_code: command exited with $exit_code: $*\"\n+\t\treturn 0\n+\telse\n+\t\techo >&2 \"test_expect_code: command exited with $exit_code, we wanted $want_code $*\"\n+\t\treturn 1\n+\tfi\n+}\n+\n # test_cmp is a helper function to compare actual and expected output.\n # You can use it like:\n #\n-- \n1.7.3.1.66.gab790\n"},{"id":"152382","messageId":"1286136014-7728-3-git-send-email-newren@gmail.com","threadId":"25321","inReplyTo":"1286136014-7728-1-git-send-email-newren@gmail.com","subject":"[PATCHv6 02/16] t3020 (ls-files-error-unmatch): remove stray '1' from end of file","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T20:00:00Z","receivedAt":"2010-10-03T20:00:00Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n t/t3020-ls-files-error-unmatch.sh |    1 -\n 1 files changed, 0 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t3020-ls-files-error-unmatch.sh b/t/t3020-ls-files-error-unmatch.sh\nindex a7d8187..ca01053 100755\n--- a/t/t3020-ls-files-error-unmatch.sh\n+++ b/t/t3020-ls-files-error-unmatch.sh\n@@ -26,4 +26,3 @@ test_expect_success \\\n     'git ls-files --error-unmatch foo bar'\n \n test_done\n-1\n-- \n1.7.3.1.66.gab790\n"},{"id":"152383","messageId":"1286136014-7728-4-git-send-email-newren@gmail.com","threadId":"25321","inReplyTo":"1286136014-7728-1-git-send-email-newren@gmail.com","subject":"[PATCHv6 03/16] t4017 (diff-retval): replace manual exit code check with test_expect_code","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T20:00:01Z","receivedAt":"2010-10-03T20:00:01Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"This commit takes advantage of Ævar Arnfjörð Bjarmason's recent change\nto test_expect_code (test-lib: make test_expect_code a test command) to\nsimplify several testcases.\n\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n t/t4017-diff-retval.sh |   69 ++++++++++++++----------------------------------\n 1 files changed, 20 insertions(+), 49 deletions(-)\n\ndiff --git a/t/t4017-diff-retval.sh b/t/t4017-diff-retval.sh\nindex 6158985..95a7ca7 100755\n--- a/t/t4017-diff-retval.sh\n+++ b/t/t4017-diff-retval.sh\n@@ -29,66 +29,49 @@ test_expect_success 'git diff --quiet -w  HEAD^ HEAD' '\n '\n \n test_expect_success 'git diff-tree HEAD^ HEAD' '\n-\tgit diff-tree --exit-code HEAD^ HEAD\n-\ttest $? = 1\n+\ttest_expect_code 1 git diff-tree --exit-code HEAD^ HEAD\n '\n test_expect_success 'git diff-tree HEAD^ HEAD -- a' '\n \tgit diff-tree --exit-code HEAD^ HEAD -- a\n-\ttest $? = 0\n '\n test_expect_success 'git diff-tree HEAD^ HEAD -- b' '\n-\tgit diff-tree --exit-code HEAD^ HEAD -- b\n-\ttest $? = 1\n+\ttest_expect_code 1 git diff-tree --exit-code HEAD^ HEAD -- b\n '\n test_expect_success 'echo HEAD | git diff-tree --stdin' '\n-\techo $(git rev-parse HEAD) | git diff-tree --exit-code --stdin\n-\ttest $? = 1\n+\techo $(git rev-parse HEAD) | test_expect_code 1 git diff-tree --exit-code --stdin\n '\n test_expect_success 'git diff-tree HEAD HEAD' '\n \tgit diff-tree --exit-code HEAD HEAD\n-\ttest $? = 0\n '\n test_expect_success 'git diff-files' '\n \tgit diff-files --exit-code\n-\ttest $? = 0\n '\n test_expect_success 'git diff-index --cached HEAD' '\n \tgit diff-index --exit-code --cached HEAD\n-\ttest $? = 0\n '\n test_expect_success 'git diff-index --cached HEAD^' '\n-\tgit diff-index --exit-code --cached HEAD^\n-\ttest $? = 1\n+\ttest_expect_code 1 git diff-index --exit-code --cached HEAD^\n '\n test_expect_success 'git diff-index --cached HEAD^' '\n \techo text >>b &&\n \techo 3 >c &&\n-\tgit add . && {\n-\t\tgit diff-index --exit-code --cached HEAD^\n-\t\ttest $? = 1\n-\t}\n+\tgit add . &&\n+\ttest_expect_code 1 git diff-index --exit-code --cached HEAD^\n '\n test_expect_success 'git diff-tree -Stext HEAD^ HEAD -- b' '\n-\tgit commit -m \"text in b\" && {\n-\t\tgit diff-tree -p --exit-code -Stext HEAD^ HEAD -- b\n-\t\ttest $? = 1\n-\t}\n+\tgit commit -m \"text in b\" &&\n+\ttest_expect_code 1 git diff-tree -p --exit-code -Stext HEAD^ HEAD -- b\n '\n test_expect_success 'git diff-tree -Snot-found HEAD^ HEAD -- b' '\n \tgit diff-tree -p --exit-code -Snot-found HEAD^ HEAD -- b\n-\ttest $? = 0\n '\n test_expect_success 'git diff-files' '\n-\techo 3 >>c && {\n-\t\tgit diff-files --exit-code\n-\t\ttest $? = 1\n-\t}\n+\techo 3 >>c &&\n+\ttest_expect_code 1 git diff-files --exit-code\n '\n test_expect_success 'git diff-index --cached HEAD' '\n-\tgit update-index c && {\n-\t\tgit diff-index --exit-code --cached HEAD\n-\t\ttest $? = 1\n-\t}\n+\tgit update-index c &&\n+\ttest_expect_code 1 git diff-index --exit-code --cached HEAD\n '\n \n test_expect_success '--check --exit-code returns 0 for no difference' '\n@@ -100,30 +83,26 @@ test_expect_success '--check --exit-code returns 0 for no difference' '\n test_expect_success '--check --exit-code returns 1 for a clean difference' '\n \n \techo \"good\" > a &&\n-\tgit diff --check --exit-code\n-\ttest $? = 1\n+\ttest_expect_code 1 git diff --check --exit-code\n \n '\n \n test_expect_success '--check --exit-code returns 3 for a dirty difference' '\n \n \techo \"bad   \" >> a &&\n-\tgit diff --check --exit-code\n-\ttest $? = 3\n+\ttest_expect_code 3 git diff --check --exit-code\n \n '\n \n test_expect_success '--check with --no-pager returns 2 for dirty difference' '\n \n-\tgit --no-pager diff --check\n-\ttest $? = 2\n+\ttest_expect_code 2 git --no-pager diff --check\n \n '\n \n test_expect_success 'check should test not just the last line' '\n \techo \"\" >>a &&\n-\tgit --no-pager diff --check\n-\ttest $? = 2\n+\ttest_expect_code 2 git --no-pager diff --check\n \n '\n \n@@ -133,10 +112,8 @@ test_expect_success 'check detects leftover conflict markers' '\n \techo binary >>b &&\n \tgit commit -m \"side\" b &&\n \ttest_must_fail git merge master &&\n-\tgit add b && (\n-\t\tgit --no-pager diff --cached --check >test.out\n-\t\ttest $? = 2\n-\t) &&\n+\tgit add b &&\n+\ttest_expect_code 2 git --no-pager diff --cached --check >test.out &&\n \ttest 3 = $(grep \"conflict marker\" test.out | wc -l) &&\n \tgit reset --hard\n '\n@@ -146,19 +123,13 @@ test_expect_success 'check honors conflict marker length' '\n \techo \">>>>>>> boo\" >>b &&\n \techo \"======\" >>a &&\n \tgit diff --check a &&\n-\t(\n-\t\tgit diff --check b\n-\t\ttest $? = 2\n-\t) &&\n+\ttest_expect_code 2 git diff --check b &&\n \tgit reset --hard &&\n \techo \">>>>>>>> boo\" >>b &&\n \techo \"========\" >>a &&\n \tgit diff --check &&\n \techo \"b conflict-marker-size=8\" >.gitattributes &&\n-\t(\n-\t\tgit diff --check b\n-\t\ttest $? = 2\n-\t) &&\n+\ttest_expect_code 2 git diff --check b &&\n \tgit diff --check a &&\n \tgit reset --hard\n '\n-- \n1.7.3.1.66.gab790\n"},{"id":"152385","messageId":"1286136014-7728-5-git-send-email-newren@gmail.com","threadId":"25321","inReplyTo":"1286136014-7728-1-git-send-email-newren@gmail.com","subject":"[PATCHv6 04/16] t100[12] (read-tree-m-2way, read_tree_m_u_2way): add missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T20:00:02Z","receivedAt":"2010-10-03T20:00:02Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Also, replace \"|| return 1\" with \"&&\" in order to keep commands chained.\n\nAcked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n t/t1001-read-tree-m-2way.sh   |   18 +++++++++---------\n t/t1002-read-tree-m-u-2way.sh |   10 +++++-----\n 2 files changed, 14 insertions(+), 14 deletions(-)\n\ndiff --git a/t/t1001-read-tree-m-2way.sh b/t/t1001-read-tree-m-2way.sh\nindex 93ca84f..c28d790 100755\n--- a/t/t1001-read-tree-m-2way.sh\n+++ b/t/t1001-read-tree-m-2way.sh\n@@ -98,8 +98,8 @@ test_expect_success \\\n      git checkout-index -u -f -q -a &&\n      git update-index --add yomin &&\n      read_tree_twoway $treeH $treeM &&\n-     git ls-files --stage >4.out || return 1\n-     git diff --no-index M.out 4.out >4diff.out\n+     git ls-files --stage >4.out &&\n+     test_must_fail git diff --no-index M.out 4.out >4diff.out &&\n      compare_change 4diff.out expected &&\n      check_cache_at yomin clean'\n \n@@ -112,8 +112,8 @@ test_expect_success \\\n      git update-index --add yomin &&\n      echo yomin yomin >yomin &&\n      read_tree_twoway $treeH $treeM &&\n-     git ls-files --stage >5.out || return 1\n-     git diff --no-index M.out 5.out >5diff.out\n+     git ls-files --stage >5.out &&\n+     test_must_fail git diff --no-index M.out 5.out >5diff.out &&\n      compare_change 5diff.out expected &&\n      check_cache_at yomin dirty'\n \n@@ -213,8 +213,8 @@ test_expect_success \\\n      echo nitfol nitfol >nitfol &&\n      git update-index --add nitfol &&\n      read_tree_twoway $treeH $treeM &&\n-     git ls-files --stage >14.out || return 1\n-     git diff --no-index M.out 14.out >14diff.out\n+     git ls-files --stage >14.out &&\n+     test_must_fail git diff --no-index M.out 14.out >14diff.out &&\n      compare_change 14diff.out expected &&\n      check_cache_at nitfol clean'\n \n@@ -227,8 +227,8 @@ test_expect_success \\\n      git update-index --add nitfol &&\n      echo nitfol nitfol nitfol >nitfol &&\n      read_tree_twoway $treeH $treeM &&\n-     git ls-files --stage >15.out || return 1\n-     git diff --no-index M.out 15.out >15diff.out\n+     git ls-files --stage >15.out &&\n+     test_must_fail git diff --no-index M.out 15.out >15diff.out &&\n      compare_change 15diff.out expected &&\n      check_cache_at nitfol dirty'\n \n@@ -377,7 +377,7 @@ test_expect_success \\\n      git ls-files --stage >treeM.out &&\n \n      rm -f a &&\n-     mkdir a\n+     mkdir a &&\n      : >a/b &&\n      git update-index --add --remove a a/b &&\n      treeH=`git write-tree` &&\ndiff --git a/t/t1002-read-tree-m-u-2way.sh b/t/t1002-read-tree-m-u-2way.sh\nindex 0241329..a4a17e0 100755\n--- a/t/t1002-read-tree-m-u-2way.sh\n+++ b/t/t1002-read-tree-m-u-2way.sh\n@@ -205,8 +205,8 @@ test_expect_success \\\n      echo nitfol nitfol >nitfol &&\n      git update-index --add nitfol &&\n      git read-tree -m -u $treeH $treeM &&\n-     git ls-files --stage >14.out || return 1\n-     git diff -U0 --no-index M.out 14.out >14diff.out\n+     git ls-files --stage >14.out &&\n+     test_must_fail git diff -U0 --no-index M.out 14.out >14diff.out &&\n      compare_change 14diff.out expected &&\n      sum bozbar frotz >actual14.sum &&\n      grep -v nitfol M.sum > expected14.sum &&\n@@ -226,8 +226,8 @@ test_expect_success \\\n      git update-index --add nitfol &&\n      echo nitfol nitfol nitfol >nitfol &&\n      git read-tree -m -u $treeH $treeM &&\n-     git ls-files --stage >15.out || return 1\n-     git diff -U0 --no-index M.out 15.out >15diff.out\n+     git ls-files --stage >15.out &&\n+     test_must_fail git diff -U0 --no-index M.out 15.out >15diff.out &&\n      compare_change 15diff.out expected &&\n      check_cache_at nitfol dirty &&\n      sum bozbar frotz >actual15.sum &&\n@@ -314,7 +314,7 @@ test_expect_success \\\n # Also make sure we did not break DF vs DF/DF case.\n test_expect_success \\\n     'DF vs DF/DF case setup.' \\\n-    'rm -f .git/index\n+    'rm -f .git/index &&\n      echo DF >DF &&\n      git update-index --add DF &&\n      treeDF=`git write-tree` &&\n-- \n1.7.3.1.66.gab790\n"},{"id":"152387","messageId":"1286136014-7728-6-git-send-email-newren@gmail.com","threadId":"25321","inReplyTo":"1286136014-7728-1-git-send-email-newren@gmail.com","subject":"[PATCHv6 05/16] t4002 (diff-basic): use test_might_fail for commands that might fail","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T20:00:03Z","receivedAt":"2010-10-03T20:00:03Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Also replace '|| return 1' by '&&' to allow chain of operations to be\nchecked for proper return status, and modify the update-index command\nas suggested by Jonathan Nieder to not exit early but try to make sure\nfiles that match the work tree are marked as matching.\n\nAcked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n t/t4002-diff-basic.sh |   12 ++++++------\n 1 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t4002-diff-basic.sh b/t/t4002-diff-basic.sh\nindex 73441a5..9fb8ca0 100755\n--- a/t/t4002-diff-basic.sh\n+++ b/t/t4002-diff-basic.sh\n@@ -205,8 +205,8 @@ test_expect_success \\\n     'rm -fr Z [A-Z][A-Z] &&\n      git read-tree $tree_A &&\n      git checkout-index -f -a &&\n-     git read-tree --reset $tree_O || return 1\n-     git update-index --refresh >/dev/null ;# this can exit non-zero\n+     git read-tree --reset $tree_O &&\n+     test_must_fail git update-index --refresh -q &&\n      git diff-files >.test-a &&\n      cmp_diff_files_output .test-a .test-recursive-OA'\n \n@@ -215,8 +215,8 @@ test_expect_success \\\n     'rm -fr Z [A-Z][A-Z] &&\n      git read-tree $tree_B &&\n      git checkout-index -f -a &&\n-     git read-tree --reset $tree_O || return 1\n-     git update-index --refresh >/dev/null ;# this can exit non-zero\n+     git read-tree --reset $tree_O &&\n+     test_must_fail git update-index --refresh -q &&\n      git diff-files >.test-a &&\n      cmp_diff_files_output .test-a .test-recursive-OB'\n \n@@ -225,8 +225,8 @@ test_expect_success \\\n     'rm -fr Z [A-Z][A-Z] &&\n      git read-tree $tree_B &&\n      git checkout-index -f -a &&\n-     git read-tree --reset $tree_A || return 1\n-     git update-index --refresh >/dev/null ;# this can exit non-zero\n+     git read-tree --reset $tree_A &&\n+     test_must_fail git update-index --refresh -q &&\n      git diff-files >.test-a &&\n      cmp_diff_files_output .test-a .test-recursive-AB'\n \n-- \n1.7.3.1.66.gab790\n"},{"id":"152391","messageId":"1286136014-7728-7-git-send-email-newren@gmail.com","threadId":"25321","inReplyTo":"1286136014-7728-1-git-send-email-newren@gmail.com","subject":"[PATCHv6 06/16] t4202 (log): Replace '<git-command> || :' with test_might_fail","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T20:00:04Z","receivedAt":"2010-10-03T20:00:04Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n t/t4202-log.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex 2e51356..1172e45 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -393,7 +393,7 @@ test_expect_success 'log --graph with merge' '\n '\n \n test_expect_success 'log.decorate configuration' '\n-\tgit config --unset-all log.decorate || :\n+\ttest_might_fail git config --unset-all log.decorate &&\n \n \tgit log --oneline >expect.none &&\n \tgit log --oneline --decorate >expect.short &&\n-- \n1.7.3.1.66.gab790\n"},{"id":"152392","messageId":"1286136014-7728-8-git-send-email-newren@gmail.com","threadId":"25321","inReplyTo":"1286136014-7728-1-git-send-email-newren@gmail.com","subject":"[PATCHv6 07/16] t3600 (rm): add lots of missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T20:00:05Z","receivedAt":"2010-10-03T20:00:05Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Also replace failing code with similar clean-up to set the appropriate\nstate the test needs.\n\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\nMay be worth considering an alternative; from\nhttp://thread.gmane.org/gmane.comp.version-control.git/157827/focus=157896:\n\n>On Sun, Oct 3, 2010 at 8:28 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>>>  test_expect_success \\\n>>>      'Test that git rm --cached foo fails if the index matches neither the file nor HEAD' '\n>>> -     echo content > foo\n>>> -     git add foo\n>>> -     git commit -m foo\n>>> +     git checkout HEAD -- foo &&\n>> [...]\n>>\n>> Why not\n>>        -       echo content > foo\n>>        -       git add foo\n>>        -       git commit -m foo\n>>        +       echo content > foo &&\n>>        +       git add foo &&\n>>        +       git commit --allow-empty -m foo &&\n>> ?\n>\n> What advantage does using these three commands have over 'git checkout\n> HEAD -- foo'?  Perhaps I'm missing something, but I don't see it.\n> It's three commands to one, and the tests don't depend on foo starting\n> with contents of 'content'; just that foo matches HEAD to start.\n\nIs there an advantage of the three-command version I'm just missing, or\ndo people just prefer it?\n\n t/t3600-rm.sh |   38 +++++++++++++++++---------------------\n 1 files changed, 17 insertions(+), 21 deletions(-)\n\ndiff --git a/t/t3600-rm.sh b/t/t3600-rm.sh\nindex b26cabd..9660ae0 100755\n--- a/t/t3600-rm.sh\n+++ b/t/t3600-rm.sh\n@@ -38,37 +38,33 @@ test_expect_success \\\n \n test_expect_success \\\n     'Test that git rm --cached foo succeeds if the index matches the file' \\\n-    'echo content > foo\n-     git add foo\n+    'echo content > foo &&\n+     git add foo &&\n      git rm --cached foo'\n \n test_expect_success \\\n     'Test that git rm --cached foo succeeds if the index matches the file' \\\n-    'echo content > foo\n-     git add foo\n-     git commit -m foo\n-     echo \"other content\" > foo\n+    'echo content > foo &&\n+     git add foo &&\n+     git commit -m foo &&\n+     echo \"other content\" > foo &&\n      git rm --cached foo'\n \n test_expect_success \\\n     'Test that git rm --cached foo fails if the index matches neither the file nor HEAD' '\n-     echo content > foo\n-     git add foo\n-     git commit -m foo\n-     echo \"other content\" > foo\n-     git add foo\n-     echo \"yet another content\" > foo\n+     git checkout HEAD -- foo &&\n+     echo \"other content\" > foo &&\n+     git add foo &&\n+     echo \"yet another content\" > foo &&\n      test_must_fail git rm --cached foo\n '\n \n test_expect_success \\\n     'Test that git rm --cached -f foo works in case where --cached only did not' \\\n-    'echo content > foo\n-     git add foo\n-     git commit -m foo\n-     echo \"other content\" > foo\n-     git add foo\n-     echo \"yet another content\" > foo\n+    'git checkout HEAD -- foo &&\n+     echo \"other content\" > foo &&\n+     git add foo &&\n+     echo \"yet another content\" > foo &&\n      git rm --cached -f foo'\n \n test_expect_success \\\n@@ -170,7 +166,7 @@ test_expect_success 'but with -f it should work.' '\n \tgit rm -f foo baz &&\n \ttest ! -f foo &&\n \ttest ! -f baz &&\n-\ttest_must_fail git ls-files --error-unmatch foo\n+\ttest_must_fail git ls-files --error-unmatch foo &&\n \ttest_must_fail git ls-files --error-unmatch baz\n '\n \n@@ -183,7 +179,7 @@ test_expect_success 'refuse to remove cached empty file with modifications' '\n \n test_expect_success 'remove intent-to-add file without --force' '\n \techo content >intent-to-add &&\n-\tgit add -N intent-to-add\n+\tgit add -N intent-to-add &&\n \tgit rm --cached intent-to-add\n '\n \n@@ -201,7 +197,7 @@ test_expect_success 'Recursive without -r fails' '\n '\n \n test_expect_success 'Recursive with -r but dirty' '\n-\techo qfwfq >>frotz/nitfol\n+\techo qfwfq >>frotz/nitfol &&\n \ttest_must_fail git rm -r frotz &&\n \ttest -d frotz &&\n \ttest -f frotz/nitfol\n-- \n1.7.3.1.66.gab790\n"},{"id":"152397","messageId":"1286136014-7728-9-git-send-email-newren@gmail.com","threadId":"25321","inReplyTo":"1286136014-7728-1-git-send-email-newren@gmail.com","subject":"[PATCHv6 08/16] t4019 (diff-wserror): add lots of missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T20:00:06Z","receivedAt":"2010-10-03T20:00:06Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Also add test_might_fail in front of the git_config --unset commands that\nmay be trying to unset a value that never got set (due to a previous\nfailing test) or that were already unset.\n\nAcked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n t/t4019-diff-wserror.sh |   53 ++++++++++++++++++++++++-----------------------\n 1 files changed, 27 insertions(+), 26 deletions(-)\n\ndiff --git a/t/t4019-diff-wserror.sh b/t/t4019-diff-wserror.sh\nindex f6d1f1e..f7c85ec 100755\n--- a/t/t4019-diff-wserror.sh\n+++ b/t/t4019-diff-wserror.sh\n@@ -36,11 +36,12 @@ prepare_output () {\n \tgit diff --color >output\n \t$grep_a \"$blue_grep\" output >error\n \t$grep_a -v \"$blue_grep\" output >normal\n+\treturn 0\n }\n \n test_expect_success default '\n \n-\tprepare_output\n+\tprepare_output &&\n \n \tgrep Eight normal >/dev/null &&\n \tgrep HT error >/dev/null &&\n@@ -52,8 +53,8 @@ test_expect_success default '\n \n test_expect_success 'without -trail' '\n \n-\tgit config core.whitespace -trail\n-\tprepare_output\n+\tgit config core.whitespace -trail &&\n+\tprepare_output &&\n \n \tgrep Eight normal >/dev/null &&\n \tgrep HT error >/dev/null &&\n@@ -65,9 +66,9 @@ test_expect_success 'without -trail' '\n \n test_expect_success 'without -trail (attribute)' '\n \n-\tgit config --unset core.whitespace\n-\techo \"F whitespace=-trail\" >.gitattributes\n-\tprepare_output\n+\ttest_might_fail git config --unset core.whitespace &&\n+\techo \"F whitespace=-trail\" >.gitattributes &&\n+\tprepare_output &&\n \n \tgrep Eight normal >/dev/null &&\n \tgrep HT error >/dev/null &&\n@@ -79,9 +80,9 @@ test_expect_success 'without -trail (attribute)' '\n \n test_expect_success 'without -space' '\n \n-\trm -f .gitattributes\n-\tgit config core.whitespace -space\n-\tprepare_output\n+\trm -f .gitattributes &&\n+\tgit config core.whitespace -space &&\n+\tprepare_output &&\n \n \tgrep Eight normal >/dev/null &&\n \tgrep HT normal >/dev/null &&\n@@ -93,9 +94,9 @@ test_expect_success 'without -space' '\n \n test_expect_success 'without -space (attribute)' '\n \n-\tgit config --unset core.whitespace\n-\techo \"F whitespace=-space\" >.gitattributes\n-\tprepare_output\n+\ttest_might_fail git config --unset core.whitespace &&\n+\techo \"F whitespace=-space\" >.gitattributes &&\n+\tprepare_output &&\n \n \tgrep Eight normal >/dev/null &&\n \tgrep HT normal >/dev/null &&\n@@ -107,9 +108,9 @@ test_expect_success 'without -space (attribute)' '\n \n test_expect_success 'with indent-non-tab only' '\n \n-\trm -f .gitattributes\n-\tgit config core.whitespace indent,-trailing,-space\n-\tprepare_output\n+\trm -f .gitattributes &&\n+\tgit config core.whitespace indent,-trailing,-space &&\n+\tprepare_output &&\n \n \tgrep Eight error >/dev/null &&\n \tgrep HT normal >/dev/null &&\n@@ -121,9 +122,9 @@ test_expect_success 'with indent-non-tab only' '\n \n test_expect_success 'with indent-non-tab only (attribute)' '\n \n-\tgit config --unset core.whitespace\n-\techo \"F whitespace=indent,-trailing,-space\" >.gitattributes\n-\tprepare_output\n+\ttest_might_fail git config --unset core.whitespace &&\n+\techo \"F whitespace=indent,-trailing,-space\" >.gitattributes &&\n+\tprepare_output &&\n \n \tgrep Eight error >/dev/null &&\n \tgrep HT normal >/dev/null &&\n@@ -135,9 +136,9 @@ test_expect_success 'with indent-non-tab only (attribute)' '\n \n test_expect_success 'with cr-at-eol' '\n \n-\trm -f .gitattributes\n-\tgit config core.whitespace cr-at-eol\n-\tprepare_output\n+\trm -f .gitattributes &&\n+\tgit config core.whitespace cr-at-eol &&\n+\tprepare_output &&\n \n \tgrep Eight normal >/dev/null &&\n \tgrep HT error >/dev/null &&\n@@ -149,9 +150,9 @@ test_expect_success 'with cr-at-eol' '\n \n test_expect_success 'with cr-at-eol (attribute)' '\n \n-\tgit config --unset core.whitespace\n-\techo \"F whitespace=trailing,cr-at-eol\" >.gitattributes\n-\tprepare_output\n+\ttest_might_fail git config --unset core.whitespace &&\n+\techo \"F whitespace=trailing,cr-at-eol\" >.gitattributes &&\n+\tprepare_output &&\n \n \tgrep Eight normal >/dev/null &&\n \tgrep HT error >/dev/null &&\n@@ -179,11 +180,11 @@ test_expect_success 'trailing empty lines (2)' '\n '\n \n test_expect_success 'do not color trailing cr in context' '\n-\tgit config --unset core.whitespace\n+\ttest_might_fail git config --unset core.whitespace &&\n \trm -f .gitattributes &&\n \techo AAAQ | tr Q \"\\015\" >G &&\n \tgit add G &&\n-\techo BBBQ | tr Q \"\\015\" >>G\n+\techo BBBQ | tr Q \"\\015\" >>G &&\n \tgit diff --color G | tr \"\\015\" Q >output &&\n \tgrep \"BBB.*${blue_grep}Q\" output &&\n \tgrep \"AAA.*\\[mQ\" output\n-- \n1.7.3.1.66.gab790\n"},{"id":"152390","messageId":"1286136014-7728-10-git-send-email-newren@gmail.com","threadId":"25321","inReplyTo":"1286136014-7728-1-git-send-email-newren@gmail.com","subject":"[PATCHv6 09/16] t4026 (color): remove unneeded and unchained command","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T20:00:07Z","receivedAt":"2010-10-03T20:00:07Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Ever since 8b12413 (color: allow multiple attributes 2010-02-27),\ndiff.color.new has been unused in t4026, so also remove the final unsetting\nof that value to make the third to last test pass with appropriate\n'&&' chaining.\n\nAcked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nAcked-by: Jeff King <peff@peff.net>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n t/t4026-color.sh |    1 -\n 1 files changed, 0 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t4026-color.sh b/t/t4026-color.sh\nindex d5ccdd0..3726a0e 100755\n--- a/t/t4026-color.sh\n+++ b/t/t4026-color.sh\n@@ -74,7 +74,6 @@ test_expect_success 'extra character after attribute' '\n '\n \n test_expect_success 'unknown color slots are ignored (diff)' '\n-\tgit config --unset diff.color.new\n \tgit config color.diff.nosuchslotwilleverbedefined white &&\n \tgit diff --color\n '\n-- \n1.7.3.1.66.gab790\n"},{"id":"152389","messageId":"1286136014-7728-11-git-send-email-newren@gmail.com","threadId":"25321","inReplyTo":"1286136014-7728-1-git-send-email-newren@gmail.com","subject":"[PATCHv6 10/16] t5602 (clone-remote-exec): add missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T20:00:08Z","receivedAt":"2010-10-03T20:00:08Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Also add a couple test_must_fail invocations where needed, and avoid\none-shot environment variable export and function calls.\n\nAcked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n t/t5602-clone-remote-exec.sh |   22 +++++++++++++++-------\n 1 files changed, 15 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t5602-clone-remote-exec.sh b/t/t5602-clone-remote-exec.sh\nindex deffdae..3f353d9 100755\n--- a/t/t5602-clone-remote-exec.sh\n+++ b/t/t5602-clone-remote-exec.sh\n@@ -5,21 +5,29 @@ test_description=clone\n . ./test-lib.sh\n \n test_expect_success setup '\n-\techo \"#!/bin/sh\" > not_ssh\n-\techo \"echo \\\"\\$*\\\" > not_ssh_output\" >> not_ssh\n-\techo \"exit 1\" >> not_ssh\n+\techo \"#!/bin/sh\" > not_ssh &&\n+\techo \"echo \\\"\\$*\\\" > not_ssh_output\" >> not_ssh &&\n+\techo \"exit 1\" >> not_ssh &&\n \tchmod +x not_ssh\n '\n \n test_expect_success 'clone calls git upload-pack unqualified with no -u option' '\n-\tGIT_SSH=./not_ssh git clone localhost:/path/to/repo junk\n-\techo \"localhost git-upload-pack '\\''/path/to/repo'\\''\" >expected\n+\t(\n+\t\tGIT_SSH=./not_ssh &&\n+\t\texport GIT_SSH &&\n+\t\ttest_must_fail git clone localhost:/path/to/repo junk\n+\t) &&\n+\techo \"localhost git-upload-pack '\\''/path/to/repo'\\''\" >expected &&\n \ttest_cmp expected not_ssh_output\n '\n \n test_expect_success 'clone calls specified git upload-pack with -u option' '\n-\tGIT_SSH=./not_ssh git clone -u ./something/bin/git-upload-pack localhost:/path/to/repo junk\n-\techo \"localhost ./something/bin/git-upload-pack '\\''/path/to/repo'\\''\" >expected\n+\t(\n+\t\tGIT_SSH=./not_ssh &&\n+\t\texport GIT_SSH &&\n+\t\ttest_must_fail git clone -u ./something/bin/git-upload-pack localhost:/path/to/repo junk\n+\t) &&\n+\techo \"localhost ./something/bin/git-upload-pack '\\''/path/to/repo'\\''\" >expected &&\n \ttest_cmp expected not_ssh_output\n '\n \n-- \n1.7.3.1.66.gab790\n"},{"id":"152395","messageId":"1286136014-7728-12-git-send-email-newren@gmail.com","threadId":"25321","inReplyTo":"1286136014-7728-1-git-send-email-newren@gmail.com","subject":"[PATCHv6 11/16] t6016 (rev-list-graph-simplify-history): add missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T20:00:09Z","receivedAt":"2010-10-03T20:00:09Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Also move repeated tag and branch deletions into a separate setup test, to\navoid failures from tags and branches having already been deleted.\n\nAcked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n t/t6016-rev-list-graph-simplify-history.sh |   29 +++++++++------------------\n 1 files changed, 10 insertions(+), 19 deletions(-)\n\ndiff --git a/t/t6016-rev-list-graph-simplify-history.sh b/t/t6016-rev-list-graph-simplify-history.sh\nindex 27fd52b..f7181d1 100755\n--- a/t/t6016-rev-list-graph-simplify-history.sh\n+++ b/t/t6016-rev-list-graph-simplify-history.sh\n@@ -29,7 +29,7 @@ test_expect_success 'set up rev-list --graph test' '\n \t# Octopus merge B and C into branch A\n \tgit checkout A &&\n \tgit merge B C &&\n-\tgit tag A4\n+\tgit tag A4 &&\n \n \ttest_commit A5 bar.txt &&\n \n@@ -39,7 +39,7 @@ test_expect_success 'set up rev-list --graph test' '\n \ttest_commit C4 bar.txt &&\n \tgit checkout A &&\n \tgit merge -s ours C &&\n-\tgit tag A6\n+\tgit tag A6 &&\n \n \ttest_commit A7 bar.txt &&\n \n@@ -90,7 +90,7 @@ test_expect_success '--graph --all' '\n # that undecorated merges are interesting, even with --simplify-by-decoration\n test_expect_success '--graph --simplify-by-decoration' '\n \trm -f expected &&\n-\tgit tag -d A4\n+\tgit tag -d A4 &&\n \techo \"* $A7\" >> expected &&\n \techo \"*   $A6\" >> expected &&\n \techo \"|\\\\  \" >> expected &&\n@@ -116,12 +116,15 @@ test_expect_success '--graph --simplify-by-decoration' '\n \ttest_cmp expected actual\n \t'\n \n-# Get rid of all decorations on branch B, and graph with it simplified away\n+test_expect_success 'setup: get rid of decorations on B' '\n+\tgit tag -d B2 &&\n+\tgit tag -d B1 &&\n+\tgit branch -d B\n+'\n+\n+# Graph with branch B simplified away\n test_expect_success '--graph --simplify-by-decoration prune branch B' '\n \trm -f expected &&\n-\tgit tag -d B2\n-\tgit tag -d B1\n-\tgit branch -d B\n \techo \"* $A7\" >> expected &&\n \techo \"*   $A6\" >> expected &&\n \techo \"|\\\\  \" >> expected &&\n@@ -143,9 +146,6 @@ test_expect_success '--graph --simplify-by-decoration prune branch B' '\n \n test_expect_success '--graph --full-history -- bar.txt' '\n \trm -f expected &&\n-\tgit tag -d B2\n-\tgit tag -d B1\n-\tgit branch -d B\n \techo \"* $A7\" >> expected &&\n \techo \"*   $A6\" >> expected &&\n \techo \"|\\\\  \" >> expected &&\n@@ -163,9 +163,6 @@ test_expect_success '--graph --full-history -- bar.txt' '\n \n test_expect_success '--graph --full-history --simplify-merges -- bar.txt' '\n \trm -f expected &&\n-\tgit tag -d B2\n-\tgit tag -d B1\n-\tgit branch -d B\n \techo \"* $A7\" >> expected &&\n \techo \"*   $A6\" >> expected &&\n \techo \"|\\\\  \" >> expected &&\n@@ -181,9 +178,6 @@ test_expect_success '--graph --full-history --simplify-merges -- bar.txt' '\n \n test_expect_success '--graph -- bar.txt' '\n \trm -f expected &&\n-\tgit tag -d B2\n-\tgit tag -d B1\n-\tgit branch -d B\n \techo \"* $A7\" >> expected &&\n \techo \"* $A5\" >> expected &&\n \techo \"* $A3\" >> expected &&\n@@ -196,9 +190,6 @@ test_expect_success '--graph -- bar.txt' '\n \n test_expect_success '--graph --sparse -- bar.txt' '\n \trm -f expected &&\n-\tgit tag -d B2\n-\tgit tag -d B1\n-\tgit branch -d B\n \techo \"* $A7\" >> expected &&\n \techo \"* $A6\" >> expected &&\n \techo \"* $A5\" >> expected &&\n-- \n1.7.3.1.66.gab790\n"},{"id":"152398","messageId":"1286136014-7728-13-git-send-email-newren@gmail.com","threadId":"25321","inReplyTo":"1286136014-7728-1-git-send-email-newren@gmail.com","subject":"[PATCHv6 12/16] t7001 (mv): add missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T20:00:10Z","receivedAt":"2010-10-03T20:00:10Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Also, prefix an expected-to-fail git mv command with 'test_must_fail'.\n\nAcked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n t/t7001-mv.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t7001-mv.sh b/t/t7001-mv.sh\nindex 65a35d9..624e6d2 100755\n--- a/t/t7001-mv.sh\n+++ b/t/t7001-mv.sh\n@@ -61,7 +61,7 @@ test_expect_success \\\n test_expect_success \\\n     'checking -f on untracked file with existing target' \\\n     'touch path0/untracked1 &&\n-     git mv -f untracked1 path0\n+     test_must_fail git mv -f untracked1 path0 &&\n      test ! -f .git/index.lock &&\n      test -f untracked1 &&\n      test -f path0/untracked1'\n-- \n1.7.3.1.66.gab790\n"},{"id":"152394","messageId":"1286136014-7728-14-git-send-email-newren@gmail.com","threadId":"25321","inReplyTo":"1286136014-7728-1-git-send-email-newren@gmail.com","subject":"[PATCHv6 13/16] t7601 (merge-pull-config): add missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T20:00:11Z","receivedAt":"2010-10-03T20:00:11Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Also prefix several relevant git merge commands with 'test_must_fail' to\nkeep the tests passing.\n\nAcked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n t/t7601-merge-pull-config.sh |   12 ++++++------\n 1 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t7601-merge-pull-config.sh b/t/t7601-merge-pull-config.sh\nindex 7ba94ea..b44b293 100755\n--- a/t/t7601-merge-pull-config.sh\n+++ b/t/t7601-merge-pull-config.sh\n@@ -114,13 +114,13 @@ test_expect_success 'setup conflicted merge' '\n test_expect_success 'merge picks up the best result' '\n \tgit config --unset-all pull.twohead &&\n \tgit reset --hard c5 &&\n-\tgit merge -s resolve c6\n+\ttest_must_fail git merge -s resolve c6 &&\n \tresolve_count=$(conflict_count) &&\n \tgit reset --hard c5 &&\n-\tgit merge -s recursive c6\n+\ttest_must_fail git merge -s recursive c6 &&\n \trecursive_count=$(conflict_count) &&\n \tgit reset --hard c5 &&\n-\tgit merge -s recursive -s resolve c6\n+\ttest_must_fail git merge -s recursive -s resolve c6 &&\n \tauto_count=$(conflict_count) &&\n \ttest $auto_count = $recursive_count &&\n \ttest $auto_count != $resolve_count\n@@ -129,13 +129,13 @@ test_expect_success 'merge picks up the best result' '\n test_expect_success 'merge picks up the best result (from config)' '\n \tgit config pull.twohead \"recursive resolve\" &&\n \tgit reset --hard c5 &&\n-\tgit merge -s resolve c6\n+\ttest_must_fail git merge -s resolve c6 &&\n \tresolve_count=$(conflict_count) &&\n \tgit reset --hard c5 &&\n-\tgit merge -s recursive c6\n+\ttest_must_fail git merge -s recursive c6 &&\n \trecursive_count=$(conflict_count) &&\n \tgit reset --hard c5 &&\n-\tgit merge c6\n+\ttest_must_fail git merge c6 &&\n \tauto_count=$(conflict_count) &&\n \ttest $auto_count = $recursive_count &&\n \ttest $auto_count != $resolve_count\n-- \n1.7.3.1.66.gab790\n"},{"id":"152388","messageId":"1286136014-7728-15-git-send-email-newren@gmail.com","threadId":"25321","inReplyTo":"1286136014-7728-1-git-send-email-newren@gmail.com","subject":"[PATCHv6 14/16] t7800 (difftool): add missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T20:00:12Z","receivedAt":"2010-10-03T20:00:12Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Also remove a call to 'git config --unset difftool.prompt', since that is\nalready unset by restore_test_defaults.\n\nAcked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n t/t7800-difftool.sh |   12 ++++++------\n 1 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh\nindex 58dc6f6..4048d10 100755\n--- a/t/t7800-difftool.sh\n+++ b/t/t7800-difftool.sh\n@@ -98,7 +98,7 @@ test_expect_success PERL 'difftool --gui works without configured diff.guitool'\n \n # Specify the diff tool using $GIT_DIFF_TOOL\n test_expect_success PERL 'GIT_DIFF_TOOL variable' '\n-\tgit config --unset diff.tool\n+\ttest_might_fail git config --unset diff.tool &&\n \tGIT_DIFF_TOOL=test-tool &&\n \texport GIT_DIFF_TOOL &&\n \n@@ -166,7 +166,7 @@ test_expect_success PERL 'difftool.prompt config variable is false' '\n \n # Test that we don't have to pass --no-prompt when mergetool.prompt is false\n test_expect_success PERL 'difftool merge.prompt = false' '\n-\tgit config --unset difftool.prompt\n+\ttest_might_fail git config --unset difftool.prompt &&\n \tgit config mergetool.prompt false &&\n \n \tdiff=$(git difftool branch) &&\n@@ -211,7 +211,7 @@ test_expect_success PERL 'difftool last flag wins' '\n # git-difftool falls back to git-mergetool config variables\n # so test that behavior here\n test_expect_success PERL 'difftool + mergetool config variables' '\n-\tremove_config_vars\n+\tremove_config_vars &&\n \tgit config merge.tool test-tool &&\n \tgit config mergetool.test-tool.cmd \"cat \\$LOCAL\" &&\n \n@@ -254,17 +254,17 @@ test_expect_success PERL 'difftool -x cat' '\n '\n \n test_expect_success PERL 'difftool --extcmd echo arg1' '\n-\tdiff=$(git difftool --no-prompt --extcmd sh\\ -c\\ \\\"echo\\ \\$1\\\" branch)\n+\tdiff=$(git difftool --no-prompt --extcmd sh\\ -c\\ \\\"echo\\ \\$1\\\" branch) &&\n \ttest \"$diff\" = file\n '\n \n test_expect_success PERL 'difftool --extcmd cat arg1' '\n-\tdiff=$(git difftool --no-prompt --extcmd sh\\ -c\\ \\\"cat\\ \\$1\\\" branch)\n+\tdiff=$(git difftool --no-prompt --extcmd sh\\ -c\\ \\\"cat\\ \\$1\\\" branch) &&\n \ttest \"$diff\" = master\n '\n \n test_expect_success PERL 'difftool --extcmd cat arg2' '\n-\tdiff=$(git difftool --no-prompt --extcmd sh\\ -c\\ \\\"cat\\ \\$2\\\" branch)\n+\tdiff=$(git difftool --no-prompt --extcmd sh\\ -c\\ \\\"cat\\ \\$2\\\" branch) &&\n \ttest \"$diff\" = branch\n '\n \n-- \n1.7.3.1.66.gab790\n"},{"id":"152396","messageId":"1286136014-7728-16-git-send-email-newren@gmail.com","threadId":"25321","inReplyTo":"1286136014-7728-1-git-send-email-newren@gmail.com","subject":"[PATCHv6 15/16] Add missing &&'s throughout the testsuite","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T20:00:13Z","receivedAt":"2010-10-03T20:00:13Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n\n>From http://thread.gmane.org/gmane.comp.version-control.git/157827/focus=157897:\n\n> On Sun, Oct 3, 2010 at 8:46 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>>> --- a/t/t1509-root-worktree.sh\n>>> +++ b/t/t1509-root-worktree.sh\n>>> @@ -232,8 +232,8 @@ say \"auto bare gitdir\"\n>>>\n>>>  # DESTROYYYYY!!!!!\n>>>  test_expect_success 'setup' '\n>>> -     rm -rf /refs /objects /info /hooks\n>>> -     rm /*\n>>> +     rm -rf /refs /objects /info /hooks &&\n>>> +     rm /* &&\n>>\n>> I'm worried that this would fail:\n>>\n>>        $ mkdir foo\n>>        $ cd foo\n>>        $ >bar\n>>        $ mkdir baz\n>>        $ rm *\n>>        rm: cannot remove `baz': Is a directory\n>>        $ echo $?\n>>        1\n>\n> How about replacing the two rm commands with a simple 'rm -rf /*'?\n\nThat's what I did in t1509 in this round; comments welcome.\n\n t/t0001-init.sh                             |    2 +-\n t/t0003-attributes.sh                       |   45 ++++++++++++--------------\n t/t0020-crlf.sh                             |    2 +-\n t/t0024-crlf-archive.sh                     |    4 +-\n t/t0026-eol-config.sh                       |    2 +-\n t/t0050-filesystem.sh                       |    6 ++--\n t/t1000-read-tree-m-3way.sh                 |    2 +-\n t/t1302-repo-version.sh                     |    2 +-\n t/t1401-symbolic-ref.sh                     |    2 +-\n t/t1402-check-ref-format.sh                 |    4 +-\n t/t1410-reflog.sh                           |    8 ++--\n t/t1501-worktree.sh                         |    2 +-\n t/t1509-root-worktree.sh                    |    5 +--\n t/t2007-checkout-symlink.sh                 |    2 +-\n t/t2016-checkout-patch.sh                   |    2 +-\n t/t2050-git-dir-relative.sh                 |    4 +-\n t/t2103-update-index-ignore-missing.sh      |    2 +-\n t/t2200-add-update.sh                       |    2 +-\n t/t3001-ls-files-others-exclude.sh          |    2 +-\n t/t3050-subprojects-fetch.sh                |    4 +-\n t/t3203-branch-output.sh                    |    6 ++--\n t/t3307-notes-man.sh                        |    2 +-\n t/t3406-rebase-message.sh                   |    6 ++--\n t/t3408-rebase-multi-line.sh                |    2 +-\n t/t3504-cherry-pick-rerere.sh               |    4 +-\n t/t3903-stash.sh                            |    4 +-\n t/t3904-stash-patch.sh                      |    2 +-\n t/t4021-format-patch-numbered.sh            |    2 +-\n t/t4027-diff-submodule.sh                   |    2 +-\n t/t4103-apply-binary.sh                     |    8 ++--\n t/t4104-apply-boundary.sh                   |    4 +-\n t/t4111-apply-subdir.sh                     |    4 +-\n t/t4119-apply-config.sh                     |    2 +-\n t/t4124-apply-ws-rule.sh                    |    4 +-\n t/t4127-apply-same-fn.sh                    |   18 +++++-----\n t/t4130-apply-criss-cross-rename.sh         |    2 +-\n t/t4133-apply-filenames.sh                  |    6 ++--\n t/t4150-am.sh                               |    2 +-\n t/t5300-pack-object.sh                      |    4 +-\n t/t5301-sliding-window.sh                   |    2 +-\n t/t5302-pack-index.sh                       |    2 +-\n t/t5500-fetch-pack.sh                       |    2 +-\n t/t5502-quickfetch.sh                       |    2 +-\n t/t5503-tagfollow.sh                        |    4 +-\n t/t5510-fetch.sh                            |    2 +-\n t/t5516-fetch-push.sh                       |   20 ++++++------\n t/t5517-push-mirror.sh                      |   10 +++---\n t/t5519-push-alternates.sh                  |    2 +-\n t/t5531-deep-submodule-push.sh              |    2 +-\n t/t5541-http-push.sh                        |    2 +-\n t/t5550-http-fetch.sh                       |    6 +--\n t/t5601-clone.sh                            |    6 ++--\n t/t5701-clone-local.sh                      |    8 ++--\n t/t5705-clone-2gb.sh                        |    2 +-\n t/t6009-rev-list-parent.sh                  |    2 +-\n t/t6010-merge-base.sh                       |    2 +-\n t/t6022-merge-rename.sh                     |    2 +-\n t/t6024-recursive-merge.sh                  |    2 +-\n t/t6030-bisect-porcelain.sh                 |    8 ++--\n t/t6040-tracking-info.sh                    |    2 +-\n t/t7004-tag.sh                              |   14 ++++----\n t/t7105-reset-patch.sh                      |    6 ++--\n t/t7300-clean.sh                            |    8 ++--\n t/t7501-commit.sh                           |    2 +-\n t/t7502-commit.sh                           |    2 +-\n t/t7506-status-submodule.sh                 |    2 +-\n t/t7600-merge.sh                            |    2 +-\n t/t7610-mergetool.sh                        |    2 +-\n t/t7700-repack.sh                           |    2 +-\n t/t8003-blame.sh                            |    6 ++--\n t/t9122-git-svn-author.sh                   |    4 +-\n t/t9123-git-svn-rebuild-with-rewriteroot.sh |    2 +-\n t/t9134-git-svn-ignore-paths.sh             |    6 ++--\n t/t9137-git-svn-dcommit-clobber-series.sh   |    2 +-\n t/t9138-git-svn-authors-prog.sh             |    6 ++--\n t/t9146-git-svn-empty-dirs.sh               |    6 ++--\n t/t9151-svn-mergeinfo.sh                    |   22 ++++++------\n t/t9200-git-cvsexportcommit.sh              |    4 +-\n t/t9401-git-cvsserver-crlf.sh               |    2 +-\n t/t9600-cvsimport.sh                        |    2 +-\n 80 files changed, 187 insertions(+), 193 deletions(-)\n\ndiff --git a/t/t0001-init.sh b/t/t0001-init.sh\nindex 7fe8883..9d4539f 100755\n--- a/t/t0001-init.sh\n+++ b/t/t0001-init.sh\n@@ -289,7 +289,7 @@ test_expect_success 'init notices EEXIST (2)' '\n \trm -fr newdir &&\n \t(\n \t\tmkdir newdir &&\n-\t\t>newdir/a\n+\t\t>newdir/a &&\n \t\ttest_must_fail git init newdir/a/b &&\n \t\ttest -f newdir/a\n \t)\ndiff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh\nindex 25205ac..80a2179 100755\n--- a/t/t0003-attributes.sh\n+++ b/t/t0003-attributes.sh\n@@ -19,27 +19,24 @@ attr_check () {\n test_expect_success 'setup' '\n \n \tmkdir -p a/b/d a/c &&\n-\t(\n-\t\techo \"[attr]notest !test\"\n-\t\techo \"f\ttest=f\"\n-\t\techo \"a/i test=a/i\"\n-\t\techo \"onoff test -test\"\n-\t\techo \"offon -test test\"\n-\t\techo \"no notest\"\n-\t) >.gitattributes &&\n-\t(\n-\t\techo \"g test=a/g\" &&\n-\t\techo \"b/g test=a/b/g\"\n-\t) >a/.gitattributes &&\n-\t(\n-\t\techo \"h test=a/b/h\" &&\n-\t\techo \"d/* test=a/b/d/*\"\n-\t\techo \"d/yes notest\"\n-\t) >a/b/.gitattributes\n-\t(\n-\t\techo \"global test=global\"\n-\t) >$HOME/global-gitattributes\n-\n+\tcat <<\\EOF >.gitattributes &&\n+[attr]notest !test\n+f\ttest=f\n+a/i test=a/i\n+onoff test -test\n+offon -test test\n+no notest\n+EOF\n+\tcat <<\\EOF >a/.gitattributes &&\n+g test=a/g\n+b/g test=a/b/g\n+EOF\n+\tcat <<\\EOF >a/b/.gitattributes\n+h test=a/b/h\n+d/* test=a/b/d/*\n+d/yes notest\n+EOF\n+\techo \"global test=global\" >$HOME/global-gitattributes\n '\n \n test_expect_success 'attribute test' '\n@@ -72,7 +69,7 @@ test_expect_success 'core.attributesfile' '\n \n test_expect_success 'attribute test: read paths from stdin' '\n \n-\tcat <<EOF > expect\n+\tcat <<\\EOF > expect &&\n f: test: f\n a/f: test: f\n a/c/f: test: f\n@@ -109,7 +106,7 @@ test_expect_success 'setup bare' '\n test_expect_success 'bare repository: check that .gitattribute is ignored' '\n \n \t(\n-\t\techo \"f\ttest=f\"\n+\t\techo \"f\ttest=f\" &&\n \t\techo \"a/i test=a/i\"\n \t) >.gitattributes &&\n \tattr_check f unspecified &&\n@@ -123,7 +120,7 @@ test_expect_success 'bare repository: check that .gitattribute is ignored' '\n test_expect_success 'bare repository: test info/attributes' '\n \n \t(\n-\t\techo \"f\ttest=f\"\n+\t\techo \"f\ttest=f\" &&\n \t\techo \"a/i test=a/i\"\n \t) >info/attributes &&\n \tattr_check f f &&\ndiff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh\nindex 234a94f..1a8f44c 100755\n--- a/t/t0020-crlf.sh\n+++ b/t/t0020-crlf.sh\n@@ -439,7 +439,7 @@ test_expect_success 'checkout when deleting .gitattributes' '\n \tgit rm .gitattributes &&\n \techo \"contentsQ\" | q_to_cr > .file2 &&\n \tgit add .file2 &&\n-\tgit commit -m third\n+\tgit commit -m third &&\n \n \tgit checkout master~1 &&\n \tgit checkout master &&\ndiff --git a/t/t0024-crlf-archive.sh b/t/t0024-crlf-archive.sh\nindex c7d0324..ec6c1b3 100755\n--- a/t/t0024-crlf-archive.sh\n+++ b/t/t0024-crlf-archive.sh\n@@ -7,7 +7,7 @@ UNZIP=${UNZIP:-unzip}\n \n test_expect_success setup '\n \n-\tgit config core.autocrlf true\n+\tgit config core.autocrlf true &&\n \n \tprintf \"CRLF line ending\\r\\nAnd another\\r\\n\" > sample &&\n \tgit add sample &&\n@@ -20,7 +20,7 @@ test_expect_success setup '\n test_expect_success 'tar archive' '\n \n \tgit archive --format=tar HEAD |\n-\t( mkdir untarred && cd untarred && \"$TAR\" -xf - )\n+\t( mkdir untarred && cd untarred && \"$TAR\" -xf - ) &&\n \n \ttest_cmp sample untarred/sample\n \ndiff --git a/t/t0026-eol-config.sh b/t/t0026-eol-config.sh\nindex f37ac8f..fe0164b 100755\n--- a/t/t0026-eol-config.sh\n+++ b/t/t0026-eol-config.sh\n@@ -12,7 +12,7 @@ test_expect_success setup '\n \n \tgit config core.autocrlf false &&\n \n-\techo \"one text\" > .gitattributes\n+\techo \"one text\" > .gitattributes &&\n \n \tfor w in Hello world how are you; do echo $w; done >one &&\n \tfor w in I am very very fine thank you; do echo $w; done >two &&\ndiff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh\nindex 41df6bc..64fa8b0 100755\n--- a/t/t0050-filesystem.sh\n+++ b/t/t0050-filesystem.sh\n@@ -12,8 +12,8 @@ unibad=\n no_symlinks=\n test_expect_success 'see what we expect' '\n \n-\ttest_case=test_expect_success\n-\ttest_unicode=test_expect_success\n+\ttest_case=test_expect_success &&\n+\ttest_unicode=test_expect_success &&\n \tmkdir junk &&\n \techo good >junk/CamelCase &&\n \techo bad >junk/camelcase &&\n@@ -128,7 +128,7 @@ test_expect_success \"setup unicode normalization tests\" '\n   cd unicode &&\n   touch \"$aumlcdiar\" &&\n   git add \"$aumlcdiar\" &&\n-  git commit -m initial\n+  git commit -m initial &&\n   git tag initial &&\n   git checkout -b topic &&\n   git mv $aumlcdiar tmp &&\ndiff --git a/t/t1000-read-tree-m-3way.sh b/t/t1000-read-tree-m-3way.sh\nindex 4f17172..ca8a409 100755\n--- a/t/t1000-read-tree-m-3way.sh\n+++ b/t/t1000-read-tree-m-3way.sh\n@@ -309,7 +309,7 @@ test_expect_success \\\n test_expect_success \\\n     '6 - must not exist in O && !A && !B case' \"\n      rm -f .git/index DD &&\n-     echo DD >DD\n+     echo DD >DD &&\n      git update-index --add DD &&\n      test_must_fail git read-tree -m $tree_O $tree_A $tree_B\n \"\ndiff --git a/t/t1302-repo-version.sh b/t/t1302-repo-version.sh\nindex a6bf1bf..0e47662 100755\n--- a/t/t1302-repo-version.sh\n+++ b/t/t1302-repo-version.sh\n@@ -39,7 +39,7 @@ test_expect_success 'gitdir selection on unsupported repo' '\n \t(\n \t\tcd test2 &&\n \t\tgit config core.repositoryformatversion >../actual\n-\t)\n+\t) &&\n \ttest_cmp expect actual\n '\n \ndiff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh\nindex 7fa5f5b..2c96551 100755\n--- a/t/t1401-symbolic-ref.sh\n+++ b/t/t1401-symbolic-ref.sh\n@@ -28,7 +28,7 @@ test_expect_success 'symbolic-ref refuses non-ref for HEAD' '\n reset_to_sane\n \n test_expect_success 'symbolic-ref refuses bare sha1' '\n-\techo content >file && git add file && git commit -m one\n+\techo content >file && git add file && git commit -m one &&\n \ttest_must_fail git symbolic-ref HEAD `git rev-parse HEAD`\n '\n reset_to_sane\ndiff --git a/t/t1402-check-ref-format.sh b/t/t1402-check-ref-format.sh\nindex 782e75d..1b0f82f 100755\n--- a/t/t1402-check-ref-format.sh\n+++ b/t/t1402-check-ref-format.sh\n@@ -32,7 +32,7 @@ test_expect_success \"check-ref-format --branch @{-1}\" '\n \tT=$(git write-tree) &&\n \tsha1=$(echo A | git commit-tree $T) &&\n \tgit update-ref refs/heads/master $sha1 &&\n-\tgit update-ref refs/remotes/origin/master $sha1\n+\tgit update-ref refs/remotes/origin/master $sha1 &&\n \tgit checkout master &&\n \tgit checkout origin/master &&\n \tgit checkout master &&\n@@ -47,7 +47,7 @@ test_expect_success 'check-ref-format --branch from subdir' '\n \tT=$(git write-tree) &&\n \tsha1=$(echo A | git commit-tree $T) &&\n \tgit update-ref refs/heads/master $sha1 &&\n-\tgit update-ref refs/remotes/origin/master $sha1\n+\tgit update-ref refs/remotes/origin/master $sha1 &&\n \tgit checkout master &&\n \tgit checkout origin/master &&\n \tgit checkout master &&\ndiff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh\nindex 25046c4..252fc82 100755\n--- a/t/t1410-reflog.sh\n+++ b/t/t1410-reflog.sh\n@@ -186,8 +186,8 @@ test_expect_success 'delete' '\n \ttest_tick &&\n \tgit commit -m tiger C &&\n \n-\tHEAD_entry_count=$(git reflog | wc -l)\n-\tmaster_entry_count=$(git reflog show master | wc -l)\n+\tHEAD_entry_count=$(git reflog | wc -l) &&\n+\tmaster_entry_count=$(git reflog show master | wc -l) &&\n \n \ttest $HEAD_entry_count = 5 &&\n \ttest $master_entry_count = 5 &&\n@@ -199,13 +199,13 @@ test_expect_success 'delete' '\n \ttest $HEAD_entry_count = $(git reflog | wc -l) &&\n \t! grep ox < output &&\n \n-\tmaster_entry_count=$(wc -l < output)\n+\tmaster_entry_count=$(wc -l < output) &&\n \n \tgit reflog delete HEAD@{1} &&\n \ttest $(($HEAD_entry_count -1)) = $(git reflog | wc -l) &&\n \ttest $master_entry_count = $(git reflog show master | wc -l) &&\n \n-\tHEAD_entry_count=$(git reflog | wc -l)\n+\tHEAD_entry_count=$(git reflog | wc -l) &&\n \n \tgit reflog delete master@{07.04.2005.15:15:00.-0700} &&\n \tgit reflog show master > output &&\ndiff --git a/t/t1501-worktree.sh b/t/t1501-worktree.sh\nindex 2c8f01f..8af9ca4 100755\n--- a/t/t1501-worktree.sh\n+++ b/t/t1501-worktree.sh\n@@ -335,7 +335,7 @@ test_expect_success 'absolute pathspec should fail gracefully' '\n '\n \n test_expect_success 'make_relative_path handles double slashes in GIT_DIR' '\n-\t>dummy_file\n+\t>dummy_file &&\n \techo git --git-dir=\"$(pwd)//repo.git\" --work-tree=\"$(pwd)\" add dummy_file &&\n \tgit --git-dir=\"$(pwd)//repo.git\" --work-tree=\"$(pwd)\" add dummy_file\n '\ndiff --git a/t/t1509-root-worktree.sh b/t/t1509-root-worktree.sh\nindex 7f60fd0..24d96c8 100755\n--- a/t/t1509-root-worktree.sh\n+++ b/t/t1509-root-worktree.sh\n@@ -209,7 +209,7 @@ unset GIT_WORK_TREE\n \n test_expect_success 'go to /' 'cd /'\n test_expect_success 'setup' '\n-\trm -rf /.git\n+\trm -rf /.git &&\n \techo \"Initialized empty Git repository in /.git/\" > expected &&\n \tgit init > result &&\n \ttest_cmp expected result\n@@ -232,8 +232,7 @@ say \"auto bare gitdir\"\n \n # DESTROYYYYY!!!!!\n test_expect_success 'setup' '\n-\trm -rf /refs /objects /info /hooks\n-\trm /*\n+\trm -rf /* &&\n \tcd / &&\n \techo \"Initialized empty Git repository in /\" > expected &&\n \tgit init --bare > result &&\ndiff --git a/t/t2007-checkout-symlink.sh b/t/t2007-checkout-symlink.sh\nindex a74ee22..e6f59f1 100755\n--- a/t/t2007-checkout-symlink.sh\n+++ b/t/t2007-checkout-symlink.sh\n@@ -17,7 +17,7 @@ test_expect_success SYMLINKS setup '\n \tgit branch side &&\n \n \techo goodbye >nitfol &&\n-\tgit add nitfol\n+\tgit add nitfol &&\n \ttest_tick &&\n \tgit commit -m \"master adds file nitfol\" &&\n \ndiff --git a/t/t2016-checkout-patch.sh b/t/t2016-checkout-patch.sh\nindex a463b13..9cd0ac4 100755\n--- a/t/t2016-checkout-patch.sh\n+++ b/t/t2016-checkout-patch.sh\n@@ -32,7 +32,7 @@ test_expect_success PERL 'git checkout -p' '\n '\n \n test_expect_success PERL 'git checkout -p with staged changes' '\n-\tset_state dir/foo work index\n+\tset_state dir/foo work index &&\n \t(echo n; echo y) | git checkout -p &&\n \tverify_saved_state bar &&\n \tverify_state dir/foo index index\ndiff --git a/t/t2050-git-dir-relative.sh b/t/t2050-git-dir-relative.sh\nindex b7131d8..21f4659 100755\n--- a/t/t2050-git-dir-relative.sh\n+++ b/t/t2050-git-dir-relative.sh\n@@ -26,7 +26,7 @@ chmod +x .git/hooks/post-commit'\n \n test_expect_success 'post-commit hook used ordinarily' '\n echo initial >top &&\n-git add top\n+git add top &&\n git commit -m initial &&\n test -r \"${COMMIT_FILE}\"\n '\n@@ -45,7 +45,7 @@ test -r \"${COMMIT_FILE}\"\n rm -rf \"${COMMIT_FILE}\"\n \n test_expect_success 'post-commit-hook from sub dir' '\n-echo changed again >top\n+echo changed again >top &&\n cd subdir &&\n git --git-dir .git --work-tree .. add ../top &&\n git --git-dir .git --work-tree .. commit -m subcommit &&\ndiff --git a/t/t2103-update-index-ignore-missing.sh b/t/t2103-update-index-ignore-missing.sh\nindex 332694e..0114f05 100755\n--- a/t/t2103-update-index-ignore-missing.sh\n+++ b/t/t2103-update-index-ignore-missing.sh\n@@ -32,7 +32,7 @@ test_expect_success basics '\n \t\ttest_create_repo xyzzy &&\n \t\tcd xyzzy &&\n \t\t>file &&\n-\t\tgit add file\n+\t\tgit add file &&\n \t\tgit commit -m \"sub initial\"\n \t) &&\n \tgit add xyzzy &&\ndiff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh\nindex 2ad2819..0692427 100755\n--- a/t/t2200-add-update.sh\n+++ b/t/t2200-add-update.sh\n@@ -25,7 +25,7 @@ test_expect_success setup '\n \techo initial >dir1/sub2 &&\n \techo initial >dir2/sub3 &&\n \tgit add check dir1 dir2 top foo &&\n-\ttest_tick\n+\ttest_tick &&\n \tgit commit -m initial &&\n \n \techo changed >check &&\ndiff --git a/t/t3001-ls-files-others-exclude.sh b/t/t3001-ls-files-others-exclude.sh\nindex 6d2f2b6..c8fe978 100755\n--- a/t/t3001-ls-files-others-exclude.sh\n+++ b/t/t3001-ls-files-others-exclude.sh\n@@ -156,7 +156,7 @@ test_expect_success 'trailing slash in exclude allows directory match (2)' '\n \n test_expect_success 'trailing slash in exclude forces directory match (1)' '\n \n-\t>two\n+\t>two &&\n \tgit ls-files --others --exclude=two/ >output &&\n \tgrep \"^two\" output\n \ndiff --git a/t/t3050-subprojects-fetch.sh b/t/t3050-subprojects-fetch.sh\nindex 4261e96..2f5f41a 100755\n--- a/t/t3050-subprojects-fetch.sh\n+++ b/t/t3050-subprojects-fetch.sh\n@@ -10,10 +10,10 @@ test_expect_success setup '\n \t\tcd sub &&\n \t\tgit init &&\n \t\t>subfile &&\n-\t\tgit add subfile\n+\t\tgit add subfile &&\n \t\tgit commit -m \"subproject commit #1\"\n \t) &&\n-\t>mainfile\n+\t>mainfile &&\n \tgit add sub mainfile &&\n \ttest_tick &&\n \tgit commit -m \"superproject commit #1\"\ndiff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh\nindex 809d1c4..6028748 100755\n--- a/t/t3203-branch-output.sh\n+++ b/t/t3203-branch-output.sh\n@@ -12,13 +12,13 @@ test_expect_success 'make commits' '\n '\n \n test_expect_success 'make branches' '\n-\tgit branch branch-one\n+\tgit branch branch-one &&\n \tgit branch branch-two HEAD^\n '\n \n test_expect_success 'make remote branches' '\n-\tgit update-ref refs/remotes/origin/branch-one branch-one\n-\tgit update-ref refs/remotes/origin/branch-two branch-two\n+\tgit update-ref refs/remotes/origin/branch-one branch-one &&\n+\tgit update-ref refs/remotes/origin/branch-two branch-two &&\n \tgit symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/branch-one\n '\n \ndiff --git a/t/t3307-notes-man.sh b/t/t3307-notes-man.sh\nindex 3269f2e..2ea3be6 100755\n--- a/t/t3307-notes-man.sh\n+++ b/t/t3307-notes-man.sh\n@@ -26,7 +26,7 @@ test_expect_success 'example 1: notes to add an Acked-by line' '\n '\n \n test_expect_success 'example 2: binary notes' '\n-\tcp \"$TEST_DIRECTORY\"/test4012.png .\n+\tcp \"$TEST_DIRECTORY\"/test4012.png . &&\n \tgit checkout B &&\n \tblob=$(git hash-object -w test4012.png) &&\n \tgit notes --ref=logo add -C \"$blob\" &&\ndiff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh\nindex 85fc7c4..506d37e 100755\n--- a/t/t3406-rebase-message.sh\n+++ b/t/t3406-rebase-message.sh\n@@ -43,20 +43,20 @@ test_expect_success 'rebase -m' '\n '\n \n test_expect_success 'rebase --stat' '\n-        git reset --hard start\n+        git reset --hard start &&\n         git rebase --stat master >diffstat.txt &&\n         grep \"^ fileX |  *1 +$\" diffstat.txt\n '\n \n test_expect_success 'rebase w/config rebase.stat' '\n-        git reset --hard start\n+        git reset --hard start &&\n         git config rebase.stat true &&\n         git rebase master >diffstat.txt &&\n         grep \"^ fileX |  *1 +$\" diffstat.txt\n '\n \n test_expect_success 'rebase -n overrides config rebase.stat config' '\n-        git reset --hard start\n+        git reset --hard start &&\n         git config rebase.stat true &&\n         git rebase -n master >diffstat.txt &&\n         ! grep \"^ fileX |  *1 +$\" diffstat.txt\ndiff --git a/t/t3408-rebase-multi-line.sh b/t/t3408-rebase-multi-line.sh\nindex 2062b85..6b84e60 100755\n--- a/t/t3408-rebase-multi-line.sh\n+++ b/t/t3408-rebase-multi-line.sh\n@@ -16,7 +16,7 @@ test_expect_success setup '\n \tgit commit -a -m \"A sample commit log message that has a long\n summary that spills over multiple lines.\n \n-But otherwise with a sane description.\"\n+But otherwise with a sane description.\" &&\n \n \tgit branch side &&\n \ndiff --git a/t/t3504-cherry-pick-rerere.sh b/t/t3504-cherry-pick-rerere.sh\nindex f7b3518..e6a6481 100755\n--- a/t/t3504-cherry-pick-rerere.sh\n+++ b/t/t3504-cherry-pick-rerere.sh\n@@ -23,7 +23,7 @@ test_expect_success 'conflicting merge' '\n test_expect_success 'fixup' '\n \techo foo-dev >foo &&\n \tgit add foo && test_tick && git commit -q -m 4 &&\n-\tgit reset --hard HEAD^\n+\tgit reset --hard HEAD^ &&\n \techo foo-dev >expect\n '\n \n@@ -33,7 +33,7 @@ test_expect_success 'cherry-pick conflict' '\n '\n \n test_expect_success 'reconfigure' '\n-\tgit config rerere.enabled false\n+\tgit config rerere.enabled false &&\n \tgit reset --hard\n '\n \ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex 903a122..06d9629 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -157,7 +157,7 @@ EOF\n \n test_expect_success 'stash branch' '\n \techo foo > file &&\n-\tgit commit file -m first\n+\tgit commit file -m first &&\n \techo bar > file &&\n \techo bar2 > file2 &&\n \tgit add file2 &&\n@@ -268,7 +268,7 @@ test_expect_success 'stash rm and ignore (stage .gitignore)' '\n \tgit add .gitignore &&\n \tgit stash save \"rm and ignore (stage .gitignore)\" &&\n \ttest bar = \"$(cat file)\" &&\n-\t! test -r .gitignore\n+\t! test -r .gitignore &&\n \tgit stash apply &&\n \t! test -r file &&\n \ttest file = \"$(cat .gitignore)\"\ndiff --git a/t/t3904-stash-patch.sh b/t/t3904-stash-patch.sh\nindex d1819ca..1e7193a 100755\n--- a/t/t3904-stash-patch.sh\n+++ b/t/t3904-stash-patch.sh\n@@ -20,7 +20,7 @@ test_expect_success PERL 'setup' '\n # note: bar sorts before dir, so the first 'n' is always to skip 'bar'\n \n test_expect_success PERL 'saying \"n\" does nothing' '\n-\tset_state dir/foo work index\n+\tset_state dir/foo work index &&\n \t(echo n; echo n) | test_must_fail git stash save -p &&\n \tverify_state dir/foo work index &&\n \tverify_saved_state bar\ndiff --git a/t/t4021-format-patch-numbered.sh b/t/t4021-format-patch-numbered.sh\nindex 709b323..886494b 100755\n--- a/t/t4021-format-patch-numbered.sh\n+++ b/t/t4021-format-patch-numbered.sh\n@@ -95,7 +95,7 @@ test_expect_success 'format.numbered && --keep-subject' '\n \n test_expect_success 'format.numbered = auto' '\n \n-\tgit config format.numbered auto\n+\tgit config format.numbered auto &&\n \tgit format-patch --stdout HEAD~2 > patch5 &&\n \ttest_numbered patch5\n \ndiff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh\nindex d99814a..e62bf2c 100755\n--- a/t/t4027-diff-submodule.sh\n+++ b/t/t4027-diff-submodule.sh\n@@ -316,7 +316,7 @@ test_expect_success 'git diff (empty submodule dir)' '\n test_expect_success 'conflicted submodule setup' '\n \n \t# 39 efs\n-\tc=fffffffffffffffffffffffffffffffffffffff\n+\tc=fffffffffffffffffffffffffffffffffffffff &&\n \t(\n \t\techo \"000000 $_z40 0\tsub\"\n \t\techo \"160000 1$c 1\tsub\"\ndiff --git a/t/t4103-apply-binary.sh b/t/t4103-apply-binary.sh\nindex 9692f16..954118c 100755\n--- a/t/t4103-apply-binary.sh\n+++ b/t/t4103-apply-binary.sh\n@@ -41,11 +41,11 @@ test_expect_success 'setup' \"\n \"\n \n test_expect_success 'stat binary diff -- should not fail.' \\\n-\t'git checkout master\n+\t'git checkout master &&\n \t git apply --stat --summary B.diff'\n \n test_expect_success 'stat binary diff (copy) -- should not fail.' \\\n-\t'git checkout master\n+\t'git checkout master &&\n \t git apply --stat --summary C.diff'\n \n test_expect_success 'check binary diff -- should fail.' \\\n@@ -69,11 +69,11 @@ test_expect_success \\\n '\n \n test_expect_success 'check binary diff with replacement.' \\\n-\t'git checkout master\n+\t'git checkout master &&\n \t git apply --check --allow-binary-replacement BF.diff'\n \n test_expect_success 'check binary diff with replacement (copy).' \\\n-\t'git checkout master\n+\t'git checkout master &&\n \t git apply --check --allow-binary-replacement CF.diff'\n \n # Now we start applying them.\ndiff --git a/t/t4104-apply-boundary.sh b/t/t4104-apply-boundary.sh\nindex c617c2a..8e97410 100755\n--- a/t/t4104-apply-boundary.sh\n+++ b/t/t4104-apply-boundary.sh\n@@ -51,7 +51,7 @@ test_expect_success setup '\n \t\techo $i\n \tdone >victim &&\n \tcat victim >del-a-expect &&\n-\tgit diff victim >del-a-patch.with\n+\tgit diff victim >del-a-patch.with &&\n \tgit diff --unified=0 >del-a-patch.without &&\n \n \t: add to the tail\n@@ -78,7 +78,7 @@ test_expect_success setup '\n \t\techo $i\n \tdone >victim &&\n \tcat victim >del-z-expect &&\n-\tgit diff victim >del-z-patch.with\n+\tgit diff victim >del-z-patch.with &&\n \tgit diff --unified=0 >del-z-patch.without &&\n \n \t: done\ndiff --git a/t/t4111-apply-subdir.sh b/t/t4111-apply-subdir.sh\nindex a52d94a..7c39843 100755\n--- a/t/t4111-apply-subdir.sh\n+++ b/t/t4111-apply-subdir.sh\n@@ -89,7 +89,7 @@ test_expect_success 'apply --index from subdir of toplevel' '\n test_expect_success 'apply from .git dir' '\n \tcp postimage expected &&\n \tcp preimage .git/file &&\n-\tcp preimage .git/objects/file\n+\tcp preimage .git/objects/file &&\n \t(\n \t\tcd .git &&\n \t\tgit apply \"$patch\"\n@@ -100,7 +100,7 @@ test_expect_success 'apply from .git dir' '\n test_expect_success 'apply from subdir of .git dir' '\n \tcp postimage expected &&\n \tcp preimage .git/file &&\n-\tcp preimage .git/objects/file\n+\tcp preimage .git/objects/file &&\n \t(\n \t\tcd .git/objects &&\n \t\tgit apply \"$patch\"\ndiff --git a/t/t4119-apply-config.sh b/t/t4119-apply-config.sh\nindex 3c73a78..82e0099 100755\n--- a/t/t4119-apply-config.sh\n+++ b/t/t4119-apply-config.sh\n@@ -73,7 +73,7 @@ D=`pwd`\n test_expect_success 'apply --whitespace=strip in subdir' '\n \n \tcd \"$D\" &&\n-\tgit config --unset-all apply.whitespace\n+\ttest_might_fail git config --unset-all apply.whitespace &&\n \trm -f sub/file1 &&\n \tcp saved sub/file1 &&\n \tgit update-index --refresh &&\ndiff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh\nindex 8a676a5..ccd694a 100755\n--- a/t/t4124-apply-ws-rule.sh\n+++ b/t/t4124-apply-ws-rule.sh\n@@ -419,7 +419,7 @@ test_expect_success 'same, but with CR-LF line endings && cr-at-eol set' '\n \tprintf \"b\\r\\n\" >>one &&\n \tprintf \"c\\r\\n\" >>one &&\n \tcp one save-one &&\n-\tprintf \"                 \\r\\n\" >>one\n+\tprintf \"                 \\r\\n\" >>one &&\n \tgit add one &&\n \tprintf \"d\\r\\n\" >>one &&\n \tcp one expect &&\n@@ -436,7 +436,7 @@ test_expect_success 'same, but with CR-LF line endings && cr-at-eol unset' '\n \tprintf \"b\\r\\n\" >>one &&\n \tprintf \"c\\r\\n\" >>one &&\n \tcp one save-one &&\n-\tprintf \"                 \\r\\n\" >>one\n+\tprintf \"                 \\r\\n\" >>one &&\n \tgit add one &&\n \tcp one expect &&\n \tprintf \"d\\r\\n\" >>one &&\ndiff --git a/t/t4127-apply-same-fn.sh b/t/t4127-apply-same-fn.sh\nindex 77200c0..972946c 100755\n--- a/t/t4127-apply-same-fn.sh\n+++ b/t/t4127-apply-same-fn.sh\n@@ -31,7 +31,7 @@ test_expect_success 'apply same filename with independent changes' '\n '\n \n test_expect_success 'apply same filename with overlapping changes' '\n-\tgit reset --hard\n+\tgit reset --hard &&\n \tmodify \"s/^d/z/\" same_fn &&\n \tgit diff > patch0 &&\n \tgit add same_fn &&\n@@ -44,8 +44,8 @@ test_expect_success 'apply same filename with overlapping changes' '\n '\n \n test_expect_success 'apply same new filename after rename' '\n-\tgit reset --hard\n-\tgit mv same_fn new_fn\n+\tgit reset --hard &&\n+\tgit mv same_fn new_fn &&\n \tmodify \"s/^d/z/\" new_fn &&\n \tgit add new_fn &&\n \tgit diff -M --cached > patch1 &&\n@@ -58,12 +58,12 @@ test_expect_success 'apply same new filename after rename' '\n '\n \n test_expect_success 'apply same old filename after rename -- should fail.' '\n-\tgit reset --hard\n-\tgit mv same_fn new_fn\n+\tgit reset --hard &&\n+\tgit mv same_fn new_fn &&\n \tmodify \"s/^d/z/\" new_fn &&\n \tgit add new_fn &&\n \tgit diff -M --cached > patch1 &&\n-\tgit mv new_fn same_fn\n+\tgit mv new_fn same_fn &&\n \tmodify \"s/^e/y/\" same_fn &&\n \tgit diff >> patch1 &&\n \tgit reset --hard &&\n@@ -71,13 +71,13 @@ test_expect_success 'apply same old filename after rename -- should fail.' '\n '\n \n test_expect_success 'apply A->B (rename), C->A (rename), A->A -- should pass.' '\n-\tgit reset --hard\n-\tgit mv same_fn new_fn\n+\tgit reset --hard &&\n+\tgit mv same_fn new_fn &&\n \tmodify \"s/^d/z/\" new_fn &&\n \tgit add new_fn &&\n \tgit diff -M --cached > patch1 &&\n \tgit commit -m \"a rename\" &&\n-\tgit mv other_fn same_fn\n+\tgit mv other_fn same_fn &&\n \tmodify \"s/^e/y/\" same_fn &&\n \tgit add same_fn &&\n \tgit diff -M --cached >> patch1 &&\ndiff --git a/t/t4130-apply-criss-cross-rename.sh b/t/t4130-apply-criss-cross-rename.sh\nindex 7cfa2d6..d173acd 100755\n--- a/t/t4130-apply-criss-cross-rename.sh\n+++ b/t/t4130-apply-criss-cross-rename.sh\n@@ -44,7 +44,7 @@ test_expect_success 'criss-cross rename' '\n \tgit reset --hard &&\n \tmv file1 tmp &&\n \tmv file2 file1 &&\n-\tmv file3 file2\n+\tmv file3 file2 &&\n \tmv tmp file3 &&\n \tcp file1 file1-swapped &&\n \tcp file2 file2-swapped &&\ndiff --git a/t/t4133-apply-filenames.sh b/t/t4133-apply-filenames.sh\nindex 3421807..88b35ae 100755\n--- a/t/t4133-apply-filenames.sh\n+++ b/t/t4133-apply-filenames.sh\n@@ -29,9 +29,9 @@ EOF\n '\n \n test_expect_success 'apply diff with inconsistent filenames in headers' '\n-\ttest_must_fail git apply bad1.patch 2>err\n-\tgrep \"inconsistent new filename\" err\n-\ttest_must_fail git apply bad2.patch 2>err\n+\ttest_must_fail git apply bad1.patch 2>err &&\n+\tgrep \"inconsistent new filename\" err &&\n+\ttest_must_fail git apply bad2.patch 2>err &&\n \tgrep \"inconsistent old filename\" err\n '\n \ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex 1c3d8ed..850fc96 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -219,7 +219,7 @@ test_expect_success 'am stays in branch' '\n \n test_expect_success 'am --signoff does not add Signed-off-by: line if already there' '\n \tgit format-patch --stdout HEAD^ >patch3 &&\n-\tsed -e \"/^Subject/ s,\\[PATCH,Re: Re: Re: & 1/5 v2,\" patch3 >patch4\n+\tsed -e \"/^Subject/ s,\\[PATCH,Re: Re: Re: & 1/5 v2,\" patch3 >patch4 &&\n \trm -fr .git/rebase-apply &&\n \tgit reset --hard &&\n \tgit checkout HEAD^ &&\ndiff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh\nindex bbb9c12..eac1e13 100755\n--- a/t/t5300-pack-object.sh\n+++ b/t/t5300-pack-object.sh\n@@ -12,7 +12,7 @@ TRASH=`pwd`\n \n test_expect_success \\\n     'setup' \\\n-    'rm -f .git/index*\n+    'rm -f .git/index* &&\n      perl -e \"print \\\"a\\\" x 4096;\" > a &&\n      perl -e \"print \\\"b\\\" x 4096;\" > b &&\n      perl -e \"print \\\"c\\\" x 4096;\" > c &&\n@@ -187,7 +187,7 @@ test_expect_success 'survive missing objects/pack directory' '\n \t\tmkdir missing-pack &&\n \t\tcd missing-pack &&\n \t\tgit init &&\n-\t\tGOP=.git/objects/pack\n+\t\tGOP=.git/objects/pack &&\n \t\trm -fr $GOP &&\n \t\tgit index-pack --stdin --keep=test <../test-3-${packname_3}.pack &&\n \t\ttest -f $GOP/pack-${packname_3}.pack &&\ndiff --git a/t/t5301-sliding-window.sh b/t/t5301-sliding-window.sh\nindex 0a24e61..bcec3e9 100755\n--- a/t/t5301-sliding-window.sh\n+++ b/t/t5301-sliding-window.sh\n@@ -8,7 +8,7 @@ test_description='mmap sliding window tests'\n \n test_expect_success \\\n     'setup' \\\n-    'rm -f .git/index*\n+    'rm -f .git/index* &&\n      for i in a b c\n      do\n          echo $i >$i &&\ndiff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh\nindex fb3a270..b34ea93 100755\n--- a/t/t5302-pack-index.sh\n+++ b/t/t5302-pack-index.sh\n@@ -8,7 +8,7 @@ test_description='pack index with 64-bit offsets and object CRC'\n \n test_expect_success \\\n     'setup' \\\n-    'rm -rf .git\n+    'rm -rf .git &&\n      git init &&\n      git config pack.threads 1 &&\n      i=1 &&\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 18376d6..bafcca7 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -91,7 +91,7 @@ test_expect_success 'setup' '\n \t\tprev=$cur &&\n \t\tcur=$(($cur+1))\n \tdone &&\n-\tadd B1 $A1\n+\tadd B1 $A1 &&\n \techo $ATIP > .git/refs/heads/A &&\n \techo $BTIP > .git/refs/heads/B &&\n \tgit symbolic-ref HEAD refs/heads/B\ndiff --git a/t/t5502-quickfetch.sh b/t/t5502-quickfetch.sh\nindex 1037a72..7a46cbd 100755\n--- a/t/t5502-quickfetch.sh\n+++ b/t/t5502-quickfetch.sh\n@@ -57,7 +57,7 @@ test_expect_success 'copy commit and tree but not blob by hand' '\n \t\tcd cloned &&\n \t\tgit count-objects | sed -e \"s/ *objects,.*//\"\n \t) ) &&\n-\ttest $cnt -eq 6\n+\ttest $cnt -eq 6 &&\n \n \tblob=$(git rev-parse HEAD:file | sed -e \"s|..|&/|\") &&\n \ttest -f \"cloned/.git/objects/$blob\" &&\ndiff --git a/t/t5503-tagfollow.sh b/t/t5503-tagfollow.sh\nindex 8a298a6..e1c3efe 100755\n--- a/t/t5503-tagfollow.sh\n+++ b/t/t5503-tagfollow.sh\n@@ -149,8 +149,8 @@ EOF\n '\n \n test_expect_success NOT_MINGW 'new clone fetch master and tags' '\n-\tgit branch -D cat\n-\trm -f $U\n+\tgit branch -D cat &&\n+\trm -f $U &&\n \t(\n \t\tmkdir clone2 &&\n \t\tcd clone2 &&\ndiff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh\nindex 9a88475..7e433b1 100755\n--- a/t/t5510-fetch.sh\n+++ b/t/t5510-fetch.sh\n@@ -119,7 +119,7 @@ test_expect_success 'fetch must not resolve short tag name' '\n test_expect_success 'fetch must not resolve short remote name' '\n \n \tcd \"$D\" &&\n-\tgit update-ref refs/remotes/six/HEAD HEAD\n+\tgit update-ref refs/remotes/six/HEAD HEAD &&\n \n \tmkdir six &&\n \tcd six &&\ndiff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh\nindex b11da79..b30ec18 100755\n--- a/t/t5516-fetch-push.sh\n+++ b/t/t5516-fetch-push.sh\n@@ -49,7 +49,7 @@ check_push_result () {\n \t(\n \t\tcd testrepo &&\n \t\tit=\"$1\" &&\n-\t\tshift\n+\t\tshift &&\n \t\tfor ref in \"$@\"\n \t\tdo\n \t\t\tr=$(git show-ref -s --verify refs/$ref) &&\n@@ -542,7 +542,7 @@ test_expect_success 'push does not update local refs on failure' '\n \tchmod +x testrepo/.git/hooks/pre-receive &&\n \t(\n \t\tcd child &&\n-\t\tgit pull .. master\n+\t\tgit pull .. master &&\n \t\ttest_must_fail git push &&\n \t\ttest $(git rev-parse master) != \\\n \t\t\t$(git rev-parse remotes/origin/master)\n@@ -586,7 +586,7 @@ test_expect_success 'push --delete refuses src:dest refspecs' '\n '\n \n test_expect_success 'warn on push to HEAD of non-bare repository' '\n-\tmk_test heads/master\n+\tmk_test heads/master &&\n \t(\n \t\tcd testrepo &&\n \t\tgit checkout master &&\n@@ -597,7 +597,7 @@ test_expect_success 'warn on push to HEAD of non-bare repository' '\n '\n \n test_expect_success 'deny push to HEAD of non-bare repository' '\n-\tmk_test heads/master\n+\tmk_test heads/master &&\n \t(\n \t\tcd testrepo &&\n \t\tgit checkout master &&\n@@ -607,7 +607,7 @@ test_expect_success 'deny push to HEAD of non-bare repository' '\n '\n \n test_expect_success 'allow push to HEAD of bare repository (bare)' '\n-\tmk_test heads/master\n+\tmk_test heads/master &&\n \t(\n \t\tcd testrepo &&\n \t\tgit checkout master &&\n@@ -619,7 +619,7 @@ test_expect_success 'allow push to HEAD of bare repository (bare)' '\n '\n \n test_expect_success 'allow push to HEAD of non-bare repository (config)' '\n-\tmk_test heads/master\n+\tmk_test heads/master &&\n \t(\n \t\tcd testrepo &&\n \t\tgit checkout master &&\n@@ -690,7 +690,7 @@ test_expect_success 'push into aliased refs (consistent)' '\n \t(\n \t\tcd child1 &&\n \t\tgit branch foo &&\n-\t\tgit symbolic-ref refs/heads/bar refs/heads/foo\n+\t\tgit symbolic-ref refs/heads/bar refs/heads/foo &&\n \t\tgit config receive.denyCurrentBranch false\n \t) &&\n \t(\n@@ -712,7 +712,7 @@ test_expect_success 'push into aliased refs (inconsistent)' '\n \t(\n \t\tcd child1 &&\n \t\tgit branch foo &&\n-\t\tgit symbolic-ref refs/heads/bar refs/heads/foo\n+\t\tgit symbolic-ref refs/heads/bar refs/heads/foo &&\n \t\tgit config receive.denyCurrentBranch false\n \t) &&\n \t(\n@@ -757,7 +757,7 @@ test_expect_success 'push --porcelain rejected' '\n \tmk_empty &&\n \tgit push testrepo refs/heads/master:refs/remotes/origin/master &&\n \t(cd testrepo &&\n-\t\tgit reset --hard origin/master^\n+\t\tgit reset --hard origin/master^ &&\n \t\tgit config receive.denyCurrentBranch true) &&\n \n \techo >.git/foo  \"To testrepo\"  &&\n@@ -771,7 +771,7 @@ test_expect_success 'push --porcelain --dry-run rejected' '\n \tmk_empty &&\n \tgit push testrepo refs/heads/master:refs/remotes/origin/master &&\n \t(cd testrepo &&\n-\t\tgit reset --hard origin/master\n+\t\tgit reset --hard origin/master &&\n \t\tgit config receive.denyCurrentBranch true) &&\n \n \techo >.git/foo  \"To testrepo\"  &&\ndiff --git a/t/t5517-push-mirror.sh b/t/t5517-push-mirror.sh\nindex e2ad260..d13606b 100755\n--- a/t/t5517-push-mirror.sh\n+++ b/t/t5517-push-mirror.sh\n@@ -71,7 +71,7 @@ test_expect_success 'push mirror force updates existing branches' '\n \t\tgit push --mirror up &&\n \t\techo two >foo && git add foo && git commit -m two &&\n \t\tgit push --mirror up &&\n-\t\tgit reset --hard HEAD^\n+\t\tgit reset --hard HEAD^ &&\n \t\tgit push --mirror up\n \t) &&\n \tmaster_master=$(cd master && git show-ref -s --verify refs/heads/master) &&\n@@ -88,7 +88,7 @@ test_expect_success 'push mirror removes branches' '\n \t\techo one >foo && git add foo && git commit -m one &&\n \t\tgit branch remove master &&\n \t\tgit push --mirror up &&\n-\t\tgit branch -D remove\n+\t\tgit branch -D remove &&\n \t\tgit push --mirror up\n \t) &&\n \t(\n@@ -170,7 +170,7 @@ test_expect_success 'push mirror force updates existing tags' '\n \t\techo two >foo && git add foo && git commit -m two &&\n \t\tgit tag -f tmaster master &&\n \t\tgit push --mirror up &&\n-\t\tgit reset --hard HEAD^\n+\t\tgit reset --hard HEAD^ &&\n \t\tgit tag -f tmaster master &&\n \t\tgit push --mirror up\n \t) &&\n@@ -188,7 +188,7 @@ test_expect_success 'push mirror removes tags' '\n \t\techo one >foo && git add foo && git commit -m one &&\n \t\tgit tag -f tremove master &&\n \t\tgit push --mirror up &&\n-\t\tgit tag -d tremove\n+\t\tgit tag -d tremove &&\n \t\tgit push --mirror up\n \t) &&\n \t(\n@@ -235,7 +235,7 @@ test_expect_success 'remote.foo.mirror adds and removes branches' '\n \t\tgit branch keep master &&\n \t\tgit branch remove master &&\n \t\tgit push up &&\n-\t\tgit branch -D remove\n+\t\tgit branch -D remove &&\n \t\tgit push up\n \t) &&\n \t(\ndiff --git a/t/t5519-push-alternates.sh b/t/t5519-push-alternates.sh\nindex 96be523..c00c9b0 100755\n--- a/t/t5519-push-alternates.sh\n+++ b/t/t5519-push-alternates.sh\n@@ -123,7 +123,7 @@ test_expect_success 'bob works and pushes again' '\n \t(\n \t\tcd alice-pub &&\n \t\tgit cat-file commit master >../bob-work/commit\n-\t)\n+\t) &&\n \t(\n \t\t# This time Bob does not pull from Alice, and\n \t\t# the master branch at her public repository points\ndiff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh\nindex 65d8d47..faa2e96 100755\n--- a/t/t5531-deep-submodule-push.sh\n+++ b/t/t5531-deep-submodule-push.sh\n@@ -6,7 +6,7 @@ test_description='unpack-objects'\n \n test_expect_success setup '\n \tmkdir pub.git &&\n-\tGIT_DIR=pub.git git init --bare\n+\tGIT_DIR=pub.git git init --bare &&\n \tGIT_DIR=pub.git git config receive.fsckobjects true &&\n \tmkdir work &&\n \t(\ndiff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh\nindex b0c2a2c..9b30cec 100755\n--- a/t/t5541-http-push.sh\n+++ b/t/t5541-http-push.sh\n@@ -121,7 +121,7 @@ test_http_push_nonff \"$HTTPD_DOCUMENT_ROOT_PATH\"/test_repo.git \\\n test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper' '\n \t# create a dissimilarly-named remote ref so that git is unable to match the\n \t# two refs (viz. local, remote) unless an explicit refspec is provided.\n-\tgit push origin master:retsam\n+\tgit push origin master:retsam &&\n \n \techo \"change changed\" > path2 &&\n \tgit commit -a -m path2 --amend &&\ndiff --git a/t/t5550-http-fetch.sh b/t/t5550-http-fetch.sh\nindex 2fb48d0..353eff1 100755\n--- a/t/t5550-http-fetch.sh\n+++ b/t/t5550-http-fetch.sh\n@@ -37,7 +37,7 @@ test_expect_success 'clone http repository' '\n test_expect_success 'fetch changes via http' '\n \techo content >>file &&\n \tgit commit -a -m two &&\n-\tgit push public\n+\tgit push public &&\n \t(cd clone && git pull) &&\n \ttest_cmp file clone/file\n '\n@@ -93,9 +93,7 @@ test_expect_success 'fetch notices corrupt idx' '\n '\n \n test_expect_success 'did not use upload-pack service' '\n-\tgrep '/git-upload-pack' <\"$HTTPD_ROOT_PATH\"/access.log >act\n-\t: >exp\n-\ttest_cmp exp act\n+\t! grep '/git-upload-pack' <\"$HTTPD_ROOT_PATH\"/access.log >act\n '\n \n stop_httpd\ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex 987e0c8..a308d97 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -9,9 +9,9 @@ test_expect_success setup '\n \trm -fr .git &&\n \ttest_create_repo src &&\n \t(\n-\t\tcd src\n-\t\t>file\n-\t\tgit add file\n+\t\tcd src &&\n+\t\t>file &&\n+\t\tgit add file &&\n \t\tgit commit -m initial\n \t)\n \ndiff --git a/t/t5701-clone-local.sh b/t/t5701-clone-local.sh\nindex 8b4c356..cfed680 100755\n--- a/t/t5701-clone-local.sh\n+++ b/t/t5701-clone-local.sh\n@@ -10,11 +10,11 @@ test_expect_success 'preparing origin repository' '\n \tgit clone --bare . a.git &&\n \tgit clone --bare . x &&\n \ttest \"$(GIT_CONFIG=a.git/config git config --bool core.bare)\" = true &&\n-\ttest \"$(GIT_CONFIG=x/config git config --bool core.bare)\" = true\n+\ttest \"$(GIT_CONFIG=x/config git config --bool core.bare)\" = true &&\n \tgit bundle create b1.bundle --all &&\n \tgit bundle create b2.bundle master &&\n \tmkdir dir &&\n-\tcp b1.bundle dir/b3\n+\tcp b1.bundle dir/b3 &&\n \tcp b1.bundle b4\n '\n \n@@ -112,7 +112,7 @@ test_expect_success 'bundle clone with nonexistent HEAD' '\n \tcd \"$D\" &&\n \tgit clone b2.bundle b2 &&\n \tcd b2 &&\n-\tgit fetch\n+\tgit fetch &&\n \ttest ! -e .git/refs/heads/master\n '\n \n@@ -124,7 +124,7 @@ test_expect_success 'clone empty repository' '\n \t git config receive.denyCurrentBranch warn) &&\n \tgit clone empty empty-clone &&\n \ttest_tick &&\n-\t(cd empty-clone\n+\t(cd empty-clone &&\n \t echo \"content\" >> foo &&\n \t git add foo &&\n \t git commit -m \"Initial commit\" &&\ndiff --git a/t/t5705-clone-2gb.sh b/t/t5705-clone-2gb.sh\nindex e9783c3..dc42932 100755\n--- a/t/t5705-clone-2gb.sh\n+++ b/t/t5705-clone-2gb.sh\n@@ -23,7 +23,7 @@ test_expect_success CLONE_2GB 'setup' '\n \t\tprintf \"blob\\nmark :$i\\ndata $blobsize\\n\" &&\n \t\t#test-genrandom $i $blobsize &&\n \t\tprintf \"%-${blobsize}s\" $i &&\n-\t\techo \"M 100644 :$i $i\" >> commit\n+\t\techo \"M 100644 :$i $i\" >> commit &&\n \t\ti=$(($i+1)) ||\n \t\techo $? > exit-status\n \t done &&\ndiff --git a/t/t6009-rev-list-parent.sh b/t/t6009-rev-list-parent.sh\nindex c8a96a9..52f7b27 100755\n--- a/t/t6009-rev-list-parent.sh\n+++ b/t/t6009-rev-list-parent.sh\n@@ -18,7 +18,7 @@ test_expect_success setup '\n \n \tcommit one &&\n \n-\ttest_tick=$(($test_tick - 2400))\n+\ttest_tick=$(($test_tick - 2400)) &&\n \n \tcommit two &&\n \tcommit three &&\ndiff --git a/t/t6010-merge-base.sh b/t/t6010-merge-base.sh\nindex 62197a3..082032e 100755\n--- a/t/t6010-merge-base.sh\n+++ b/t/t6010-merge-base.sh\n@@ -131,7 +131,7 @@ test_expect_success 'unsynchronized clocks' '\n \tR2=$(doit  3 R2 $R1) &&\n \n \tPL=$(doit  4 PL $L2 $C2) &&\n-\tPR=$(doit  4 PR $C2 $R2)\n+\tPR=$(doit  4 PR $C2 $R2) &&\n \n \tgit name-rev $C2 >expected &&\n \ndiff --git a/t/t6022-merge-rename.sh b/t/t6022-merge-rename.sh\nindex b66544b..80adaf6 100755\n--- a/t/t6022-merge-rename.sh\n+++ b/t/t6022-merge-rename.sh\n@@ -332,7 +332,7 @@ test_expect_success 'interference with untracked working tree file' '\n '\n \n test_expect_success 'merge of identical changes in a renamed file' '\n-\trm -f A M N\n+\trm -f A M N &&\n \tgit reset --hard &&\n \tgit checkout change+rename &&\n \tGIT_MERGE_VERBOSITY=3 git merge change | grep \"^Skipped B\" &&\ndiff --git a/t/t6024-recursive-merge.sh b/t/t6024-recursive-merge.sh\nindex b3fbf65..755d30c 100755\n--- a/t/t6024-recursive-merge.sh\n+++ b/t/t6024-recursive-merge.sh\n@@ -104,7 +104,7 @@ test_expect_success 'mark rename/delete as unmerged' '\n \ttest_tick &&\n \tgit commit -m delete &&\n \tgit checkout -b rename HEAD^ &&\n-\tgit mv a1 a2\n+\tgit mv a1 a2 &&\n \ttest_tick &&\n \tgit commit -m rename &&\n \ttest_must_fail git merge delete &&\ndiff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh\nindex 3b042aa..b5063b6 100755\n--- a/t/t6030-bisect-porcelain.sh\n+++ b/t/t6030-bisect-porcelain.sh\n@@ -517,13 +517,13 @@ test_expect_success '\"parallel\" side branch creation' '\n \tadd_line_into_file \"2(para): line 2 on parallel branch\" dir2/file2 &&\n \tPARA_HASH2=$(git rev-parse --verify HEAD) &&\n \tadd_line_into_file \"3(para): line 3 on parallel branch\" dir2/file3 &&\n-\tPARA_HASH3=$(git rev-parse --verify HEAD)\n+\tPARA_HASH3=$(git rev-parse --verify HEAD) &&\n \tgit merge -m \"merge HASH4 and PARA_HASH3\" \"$HASH4\" &&\n-\tPARA_HASH4=$(git rev-parse --verify HEAD)\n+\tPARA_HASH4=$(git rev-parse --verify HEAD) &&\n \tadd_line_into_file \"5(para): add line on parallel branch\" dir1/file1 &&\n-\tPARA_HASH5=$(git rev-parse --verify HEAD)\n+\tPARA_HASH5=$(git rev-parse --verify HEAD) &&\n \tadd_line_into_file \"6(para): add line on parallel branch\" dir2/file2 &&\n-\tPARA_HASH6=$(git rev-parse --verify HEAD)\n+\tPARA_HASH6=$(git rev-parse --verify HEAD) &&\n \tgit merge -m \"merge HASH7 and PARA_HASH6\" \"$HASH7\" &&\n \tPARA_HASH7=$(git rev-parse --verify HEAD)\n '\ndiff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh\nindex 1785e17..1e0447f 100755\n--- a/t/t6040-tracking-info.sh\n+++ b/t/t6040-tracking-info.sh\n@@ -60,7 +60,7 @@ test_expect_success 'checkout' '\n \n test_expect_success 'checkout with local tracked branch' '\n \tgit checkout master &&\n-\tgit checkout follower >actual\n+\tgit checkout follower >actual &&\n \tgrep \"is ahead of\" actual\n '\n \ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex ac943f5..ee44331 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -1122,7 +1122,7 @@ v2.0\n EOF\n \n test_expect_success 'checking that first commit is in all tags (hash)' \"\n-\tgit tag -l --contains $hash1 v* >actual\n+\tgit tag -l --contains $hash1 v* >actual &&\n \ttest_cmp expected actual\n \"\n \n@@ -1201,18 +1201,18 @@ v4.0\n EOF\n \n test_expect_success 'checking that initial commit is in all tags' \"\n-\tgit tag -l --contains $hash1 v* >actual\n+\tgit tag -l --contains $hash1 v* >actual &&\n \ttest_cmp expected actual\n \"\n \n # mixing modes and options:\n \n test_expect_success 'mixing incompatibles modes and options is forbidden' '\n-\ttest_must_fail git tag -a\n-\ttest_must_fail git tag -l -v\n-\ttest_must_fail git tag -n 100\n-\ttest_must_fail git tag -l -m msg\n-\ttest_must_fail git tag -l -F some file\n+\ttest_must_fail git tag -a &&\n+\ttest_must_fail git tag -l -v &&\n+\ttest_must_fail git tag -n 100 &&\n+\ttest_must_fail git tag -l -m msg &&\n+\ttest_must_fail git tag -l -F some file &&\n \ttest_must_fail git tag -v -s\n '\n \ndiff --git a/t/t7105-reset-patch.sh b/t/t7105-reset-patch.sh\nindex 9891e2c..95fab20 100755\n--- a/t/t7105-reset-patch.sh\n+++ b/t/t7105-reset-patch.sh\n@@ -18,7 +18,7 @@ test_expect_success PERL 'setup' '\n # note: bar sorts before foo, so the first 'n' is always to skip 'bar'\n \n test_expect_success PERL 'saying \"n\" does nothing' '\n-\tset_and_save_state dir/foo work work\n+\tset_and_save_state dir/foo work work &&\n \t(echo n; echo n) | git reset -p &&\n \tverify_saved_state dir/foo &&\n \tverify_saved_state bar\n@@ -42,14 +42,14 @@ test_expect_success PERL 'git reset -p HEAD^' '\n # the failure case (and thus get out of the loop).\n \n test_expect_success PERL 'git reset -p dir' '\n-\tset_state dir/foo work work\n+\tset_state dir/foo work work &&\n \t(echo y; echo n) | git reset -p dir &&\n \tverify_state dir/foo work head &&\n \tverify_saved_state bar\n '\n \n test_expect_success PERL 'git reset -p -- foo (inside dir)' '\n-\tset_state dir/foo work work\n+\tset_state dir/foo work work &&\n \t(echo y; echo n) | (cd dir && git reset -p -- foo) &&\n \tverify_state dir/foo work head &&\n \tverify_saved_state bar\ndiff --git a/t/t7300-clean.sh b/t/t7300-clean.sh\nindex 6c776e9..3a200a9 100755\n--- a/t/t7300-clean.sh\n+++ b/t/t7300-clean.sh\n@@ -179,11 +179,11 @@ test_expect_success 'git clean -d with prefix and path' '\n \n '\n \n-test_expect_success 'git clean symbolic link' '\n+test_expect_success SYMLINKS 'git clean symbolic link' '\n \n \tmkdir -p build docs &&\n \ttouch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n-\tln -s docs/manual.txt src/part4.c\n+\tln -s docs/manual.txt src/part4.c &&\n \tgit clean &&\n \ttest -f Makefile &&\n \ttest -f README &&\n@@ -404,7 +404,7 @@ test_expect_success 'nested git work tree' '\n \t(\n \t\tcd foo &&\n \t\tgit init &&\n-\t\t>hello.world\n+\t\t>hello.world &&\n \t\tgit add . &&\n \t\tgit commit -a -m nested\n \t) &&\n@@ -424,7 +424,7 @@ test_expect_success 'force removal of nested git work tree' '\n \t(\n \t\tcd foo &&\n \t\tgit init &&\n-\t\t>hello.world\n+\t\t>hello.world &&\n \t\tgit add . &&\n \t\tgit commit -a -m nested\n \t) &&\ndiff --git a/t/t7501-commit.sh b/t/t7501-commit.sh\nindex 8297cb4..2f8a4f4 100755\n--- a/t/t7501-commit.sh\n+++ b/t/t7501-commit.sh\n@@ -351,7 +351,7 @@ test_expect_success 'git commit <file> with dirty index' '\n \n test_expect_success 'same tree (single parent)' '\n \n-\tgit reset --hard\n+\tgit reset --hard &&\n \n \tif git commit -m empty\n \tthen\ndiff --git a/t/t7502-commit.sh b/t/t7502-commit.sh\nindex ac2e187..b6b9802 100755\n--- a/t/t7502-commit.sh\n+++ b/t/t7502-commit.sh\n@@ -390,7 +390,7 @@ try_commit_status_combo () {\n \n \ttest_expect_success 'commit --no-status' '\n \t\tclear_config commit.status &&\n-\t\ttry_commit --no-status\n+\t\ttry_commit --no-status &&\n \t\t! grep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \ndiff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh\nindex 3d4f85d..f497001 100755\n--- a/t/t7506-status-submodule.sh\n+++ b/t/t7506-status-submodule.sh\n@@ -159,7 +159,7 @@ test_expect_success 'status with added and untracked file in modified submodule\n \n test_expect_success 'setup .git file for sub' '\n \t(cd sub &&\n-\t rm -f new-file\n+\t rm -f new-file &&\n \t REAL=\"$(pwd)/../.real\" &&\n \t mv .git \"$REAL\"\n \t echo \"gitdir: $REAL\" >.git) &&\ndiff --git a/t/t7600-merge.sh b/t/t7600-merge.sh\nindex b4f40e4..9351e1d 100755\n--- a/t/t7600-merge.sh\n+++ b/t/t7600-merge.sh\n@@ -128,7 +128,7 @@ test_expect_success 'setup' '\n \ttest_tick &&\n \tgit commit -m \"commit 3\" &&\n \tgit tag c3 &&\n-\tc3=$(git rev-parse HEAD)\n+\tc3=$(git rev-parse HEAD) &&\n \tgit reset --hard \"$c0\" &&\n \tcreate_merge_msgs\n '\ndiff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh\nindex 3bd7404..d78bdec 100755\n--- a/t/t7610-mergetool.sh\n+++ b/t/t7610-mergetool.sh\n@@ -54,7 +54,7 @@ test_expect_success 'custom mergetool' '\n \n test_expect_success 'mergetool crlf' '\n     git config core.autocrlf true &&\n-    git checkout -b test2 branch1\n+    git checkout -b test2 branch1 &&\n     test_must_fail git merge master >/dev/null 2>&1 &&\n     ( yes \"\" | git mergetool file1 >/dev/null 2>&1 ) &&\n     ( yes \"\" | git mergetool file2 >/dev/null 2>&1 ) &&\ndiff --git a/t/t7700-repack.sh b/t/t7700-repack.sh\nindex c2f66ff..bd07f4e 100755\n--- a/t/t7700-repack.sh\n+++ b/t/t7700-repack.sh\n@@ -56,7 +56,7 @@ test_expect_success 'loose objects in alternate ODB are not repacked' '\n '\n \n test_expect_success 'packed obs in alt ODB are repacked even when local repo is packless' '\n-\tmkdir alt_objects/pack\n+\tmkdir alt_objects/pack &&\n \tmv .git/objects/pack/* alt_objects/pack &&\n \tgit repack -a &&\n \tmyidx=$(ls -1 .git/objects/pack/*.idx) &&\ndiff --git a/t/t8003-blame.sh b/t/t8003-blame.sh\nindex 230143c..5b49156 100755\n--- a/t/t8003-blame.sh\n+++ b/t/t8003-blame.sh\n@@ -153,15 +153,15 @@ test_expect_success 'blame path that used to be a directory' '\n '\n \n test_expect_success 'blame to a commit with no author name' '\n-  TREE=`git rev-parse HEAD:`\n-  cat >badcommit <<EOF\n+  TREE=`git rev-parse HEAD:` &&\n+  cat >badcommit <<EOF &&\n tree $TREE\n author <noname> 1234567890 +0000\n committer David Reiss <dreiss@facebook.com> 1234567890 +0000\n \n some message\n EOF\n-  COMMIT=`git hash-object -t commit -w badcommit`\n+  COMMIT=`git hash-object -t commit -w badcommit` &&\n   git --no-pager blame $COMMIT -- uno >/dev/null\n '\n \ndiff --git a/t/t9122-git-svn-author.sh b/t/t9122-git-svn-author.sh\nindex 30013b7..9fe0dd2 100755\n--- a/t/t9122-git-svn-author.sh\n+++ b/t/t9122-git-svn-author.sh\n@@ -7,8 +7,8 @@ test_expect_success 'setup svn repository' '\n \tsvn_cmd checkout \"$svnrepo\" work.svn &&\n \t(\n \t\tcd work.svn &&\n-\t\techo >file\n-\t\tsvn_cmd add file\n+\t\techo >file &&\n+\t\tsvn_cmd add file &&\n \t\tsvn_cmd commit -m \"first commit\" file\n \t)\n '\ndiff --git a/t/t9123-git-svn-rebuild-with-rewriteroot.sh b/t/t9123-git-svn-rebuild-with-rewriteroot.sh\nindex 0ed90d9..fd81847 100755\n--- a/t/t9123-git-svn-rebuild-with-rewriteroot.sh\n+++ b/t/t9123-git-svn-rebuild-with-rewriteroot.sh\n@@ -16,7 +16,7 @@ rm -rf import\n \n test_expect_success 'init, fetch and checkout repository' '\n \tgit svn init --rewrite-root=http://invalid.invalid/ \"$svnrepo\" &&\n-\tgit svn fetch\n+\tgit svn fetch &&\n \tgit checkout -b mybranch ${remotes_git_svn}\n \t'\n \ndiff --git a/t/t9134-git-svn-ignore-paths.sh b/t/t9134-git-svn-ignore-paths.sh\nindex 09ff10c..fff49c4 100755\n--- a/t/t9134-git-svn-ignore-paths.sh\n+++ b/t/t9134-git-svn-ignore-paths.sh\n@@ -82,7 +82,7 @@ test_expect_success 'update git svn-cloned repo (option ignore)' '\n test_expect_success 'SVN-side change inside of ignored www' '\n \t(\n \t\tcd s &&\n-\t\techo zaq >> www/test_www.txt\n+\t\techo zaq >> www/test_www.txt &&\n \t\tsvn_cmd commit -m \"SVN-side change inside of www/test_www.txt\" &&\n \t\tsvn_cmd up &&\n \t\tsvn_cmd log -v | fgrep \"SVN-side change inside of www/test_www.txt\"\n@@ -114,8 +114,8 @@ test_expect_success 'update git svn-cloned repo (option ignore)' '\n test_expect_success 'SVN-side change in and out of ignored www' '\n \t(\n \t\tcd s &&\n-\t\techo cvf >> www/test_www.txt\n-\t\techo ygg >> qqq/test_qqq.txt\n+\t\techo cvf >> www/test_www.txt &&\n+\t\techo ygg >> qqq/test_qqq.txt &&\n \t\tsvn_cmd commit -m \"SVN-side change in and out of ignored www\" &&\n \t\tsvn_cmd up &&\n \t\tsvn_cmd log -v | fgrep \"SVN-side change in and out of ignored www\"\ndiff --git a/t/t9137-git-svn-dcommit-clobber-series.sh b/t/t9137-git-svn-dcommit-clobber-series.sh\nindex d60da63..ad01487 100755\n--- a/t/t9137-git-svn-dcommit-clobber-series.sh\n+++ b/t/t9137-git-svn-dcommit-clobber-series.sh\n@@ -7,7 +7,7 @@ test_description='git svn dcommit clobber series'\n test_expect_success 'initialize repo' '\n \tmkdir import &&\n \t(cd import &&\n-\tawk \"BEGIN { for (i = 1; i < 64; i++) { print i } }\" > file\n+\tawk \"BEGIN { for (i = 1; i < 64; i++) { print i } }\" > file &&\n \tsvn_cmd import -m \"initial\" . \"$svnrepo\"\n \t) &&\n \tgit svn init \"$svnrepo\" &&\ndiff --git a/t/t9138-git-svn-authors-prog.sh b/t/t9138-git-svn-authors-prog.sh\nindex 83cc5fc..7102ab9 100755\n--- a/t/t9138-git-svn-authors-prog.sh\n+++ b/t/t9138-git-svn-authors-prog.sh\n@@ -37,14 +37,14 @@ test_expect_success 'import authors with prog and file' '\n \n test_expect_success 'imported 6 revisions successfully' '\n \t(\n-\t\tcd x\n+\t\tcd x &&\n \t\ttest \"`git rev-list refs/remotes/git-svn | wc -l`\" -eq 6\n \t)\n \t'\n \n test_expect_success 'authors-prog ran correctly' '\n \t(\n-\t\tcd x\n+\t\tcd x &&\n \t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \\\n \t\t  grep \"^author ee-foo <ee-foo@example\\.com> \" &&\n \t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~2 | \\\n@@ -60,7 +60,7 @@ test_expect_success 'authors-prog ran correctly' '\n \n test_expect_success 'authors-file overrode authors-prog' '\n \t(\n-\t\tcd x\n+\t\tcd x &&\n \t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n \t\t  grep \"^author FFFFFFF FFFFFFF <fFf@other\\.example\\.com> \"\n \t)\ndiff --git a/t/t9146-git-svn-empty-dirs.sh b/t/t9146-git-svn-empty-dirs.sh\nindex 565365c..14b4c48 100755\n--- a/t/t9146-git-svn-empty-dirs.sh\n+++ b/t/t9146-git-svn-empty-dirs.sh\n@@ -33,7 +33,7 @@ test_expect_success 'more emptiness' '\n '\n \n test_expect_success 'git svn rebase creates empty directory' '\n-\t( cd cloned && git svn rebase )\n+\t( cd cloned && git svn rebase ) &&\n \ttest -d cloned/\"! !\"\n '\n \n@@ -65,13 +65,13 @@ test_expect_success 'git svn mkdirs -r works' '\n \t\t\t\techo >&2 \"$i does not exist\"\n \t\t\t\texit 1\n \t\t\tfi\n-\t\tdone\n+\t\tdone &&\n \n \t\tif test -d \"! !\"\n \t\tthen\n \t\t\techo >&2 \"$i should not exist\"\n \t\t\texit 1\n-\t\tfi\n+\t\tfi &&\n \n \t\tgit svn mkdirs -r8 &&\n \t\tif ! test -d \"! !\"\ndiff --git a/t/t9151-svn-mergeinfo.sh b/t/t9151-svn-mergeinfo.sh\nindex 250c651..4f6c06e 100755\n--- a/t/t9151-svn-mergeinfo.sh\n+++ b/t/t9151-svn-mergeinfo.sh\n@@ -18,39 +18,39 @@ test_expect_success 'load svn dump' \"\n \n test_expect_success 'all svn merges became git merge commits' '\n \tunmarked=$(git rev-list --parents --all --grep=Merge |\n-\t\tgrep -v \" .* \" | cut -f1 -d\" \")\n+\t\tgrep -v \" .* \" | cut -f1 -d\" \") &&\n \t[ -z \"$unmarked\" ]\n \t'\n \n test_expect_success 'cherry picks did not become git merge commits' '\n \tbad_cherries=$(git rev-list --parents --all --grep=Cherry |\n-\t\tgrep \" .* \" | cut -f1 -d\" \")\n+\t\tgrep \" .* \" | cut -f1 -d\" \") &&\n \t[ -z \"$bad_cherries\" ]\n \t'\n \n test_expect_success 'svn non-merge merge commits did not become git merge commits' '\n \tbad_non_merges=$(git rev-list --parents --all --grep=non-merge |\n-\t\tgrep \" .* \" | cut -f1 -d\" \")\n+\t\tgrep \" .* \" | cut -f1 -d\" \") &&\n \t[ -z \"$bad_non_merges\" ]\n \t'\n \n test_expect_success 'commit made to merged branch is reachable from the merge' '\n-\tbefore_commit=$(git rev-list --all --grep=\"trunk commit before merging trunk to b2\")\n-\tmerge_commit=$(git rev-list --all --grep=\"Merge trunk to b2\")\n-\tnot_reachable=$(git rev-list -1 $before_commit --not $merge_commit)\n+\tbefore_commit=$(git rev-list --all --grep=\"trunk commit before merging trunk to b2\") &&\n+\tmerge_commit=$(git rev-list --all --grep=\"Merge trunk to b2\") &&\n+\tnot_reachable=$(git rev-list -1 $before_commit --not $merge_commit) &&\n \t[ -z \"$not_reachable\" ]\n \t'\n \n test_expect_success 'merging two branches in one commit is detected correctly' '\n-\tf1_commit=$(git rev-list --all --grep=\"make f1 branch from trunk\")\n-\tf2_commit=$(git rev-list --all --grep=\"make f2 branch from trunk\")\n-\tmerge_commit=$(git rev-list --all --grep=\"Merge f1 and f2 to trunk\")\n-\tnot_reachable=$(git rev-list -1 $f1_commit $f2_commit --not $merge_commit)\n+\tf1_commit=$(git rev-list --all --grep=\"make f1 branch from trunk\") &&\n+\tf2_commit=$(git rev-list --all --grep=\"make f2 branch from trunk\") &&\n+\tmerge_commit=$(git rev-list --all --grep=\"Merge f1 and f2 to trunk\") &&\n+\tnot_reachable=$(git rev-list -1 $f1_commit $f2_commit --not $merge_commit) &&\n \t[ -z \"$not_reachable\" ]\n \t'\n \n test_expect_failure 'everything got merged in the end' '\n-\tunmerged=$(git rev-list --all --not master)\n+\tunmerged=$(git rev-list --all --not master) &&\n \t[ -z \"$unmerged\" ]\n \t'\n \ndiff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh\nindex e5da65b..70c1af0 100755\n--- a/t/t9200-git-cvsexportcommit.sh\n+++ b/t/t9200-git-cvsexportcommit.sh\n@@ -182,7 +182,7 @@ test_expect_success \\\n       git commit -a -m \"Update with spaces\" &&\n       id=$(git rev-list --max-count=1 HEAD) &&\n       (cd \"$CVSWORK\" &&\n-      git cvsexportcommit -c $id\n+      git cvsexportcommit -c $id &&\n       check_entries \"G g\" \"with spaces.png/1.2/-kb|with spaces.txt/1.2/\"\n       )'\n \n@@ -240,7 +240,7 @@ test_expect_success FILEMODE \\\n       git add G/off &&\n       git commit -a -m \"Execute test\" &&\n       (cd \"$CVSWORK\" &&\n-      git cvsexportcommit -c HEAD\n+      git cvsexportcommit -c HEAD &&\n       test -x G/on &&\n       ! test -x G/off\n       )'\ndiff --git a/t/t9401-git-cvsserver-crlf.sh b/t/t9401-git-cvsserver-crlf.sh\nindex 1bbfd82..ff6d6fb 100755\n--- a/t/t9401-git-cvsserver-crlf.sh\n+++ b/t/t9401-git-cvsserver-crlf.sh\n@@ -70,7 +70,7 @@ test_expect_success 'setup' '\n     mkdir subdir &&\n     echo \"Another text file\" > subdir/file.h &&\n     echo \"Another binary: Q (this time CR)\" | q_to_cr > subdir/withCr.bin &&\n-    echo \"Mixed up NUL, but marked text: Q <- there\" | q_to_nul > mixedUp.c\n+    echo \"Mixed up NUL, but marked text: Q <- there\" | q_to_nul > mixedUp.c &&\n     echo \"Unspecified\" > subdir/unspecified.other &&\n     echo \"/*.bin -crlf\" > .gitattributes &&\n     echo \"/*.c crlf\" >> .gitattributes &&\ndiff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh\nindex 432b82e..db081e7 100755\n--- a/t/t9600-cvsimport.sh\n+++ b/t/t9600-cvsimport.sh\n@@ -128,7 +128,7 @@ test_expect_success PERL 'second update has correct .git/cvs-revisions' '\n \n \t(cd module-git &&\n \t git log --format=\"o_fortuna 1.1 %H\" -1 HEAD^^ &&\n-\t git log --format=\"o_fortuna 1.2 %H\" -1 HEAD^\n+\t git log --format=\"o_fortuna 1.2 %H\" -1 HEAD^ &&\n \t git log --format=\"tick 1.1 %H\" -1 HEAD) > expected &&\n \ttest_cmp expected module-git/.git/cvs-revisions\n '\n-- \n1.7.3.1.66.gab790\n"},{"id":"152393","messageId":"1286136014-7728-17-git-send-email-newren@gmail.com","threadId":"25321","inReplyTo":"1286136014-7728-1-git-send-email-newren@gmail.com","subject":"[PATCHv6 16/16] Introduce portable_unset and use it to ensure proper && chaining","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T20:00:14Z","receivedAt":"2010-10-03T20:00:14Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n t/README          |   13 +++++--------\n t/t0001-init.sh   |   28 ++++++++++++++--------------\n t/t7006-pager.sh  |   10 +++++-----\n t/t7502-commit.sh |    4 ++--\n t/test-lib.sh     |   11 +++++++++++\n 5 files changed, 37 insertions(+), 29 deletions(-)\n\ndiff --git a/t/README b/t/README\nindex ee4c0cf..e10c0ce 100644\n--- a/t/README\n+++ b/t/README\n@@ -259,14 +259,11 @@ Do:\n \ttest ...\n \n    That way all of the commands in your tests will succeed or fail. If\n-   you must ignore the return value of something (e.g., the return\n-   after unsetting a variable that was already unset is unportable) it's\n-   best to indicate so explicitly with a semicolon:\n-\n-\tunset HLAGH;\n-\tgit merge hla &&\n-\tgit push gh &&\n-\ttest ...\n+   you must ignore the return value of something, consider using a\n+   helper function (e.g. use portable_unset instead of unset, in order\n+   to avoid unportable return value for unsetting a variable that was\n+   already unset), or prepending the command with test_might_fail or\n+   test_must_fail.\n \n  - Check the test coverage for your tests. See the \"Test coverage\"\n    below.\ndiff --git a/t/t0001-init.sh b/t/t0001-init.sh\nindex 9d4539f..c1b6ac2 100755\n--- a/t/t0001-init.sh\n+++ b/t/t0001-init.sh\n@@ -25,7 +25,7 @@ check_config () {\n \n test_expect_success 'plain' '\n \t(\n-\t\tunset GIT_DIR GIT_WORK_TREE\n+\t\tportable_unset GIT_DIR GIT_WORK_TREE &&\n \t\tmkdir plain &&\n \t\tcd plain &&\n \t\tgit init\n@@ -35,7 +35,7 @@ test_expect_success 'plain' '\n \n test_expect_success 'plain with GIT_WORK_TREE' '\n \tif (\n-\t\tunset GIT_DIR\n+\t\tportable_unset GIT_DIR &&\n \t\tmkdir plain-wt &&\n \t\tcd plain-wt &&\n \t\tGIT_WORK_TREE=$(pwd) git init\n@@ -48,7 +48,7 @@ test_expect_success 'plain with GIT_WORK_TREE' '\n \n test_expect_success 'plain bare' '\n \t(\n-\t\tunset GIT_DIR GIT_WORK_TREE GIT_CONFIG\n+\t\tportable_unset GIT_DIR GIT_WORK_TREE GIT_CONFIG &&\n \t\tmkdir plain-bare-1 &&\n \t\tcd plain-bare-1 &&\n \t\tgit --bare init\n@@ -58,7 +58,7 @@ test_expect_success 'plain bare' '\n \n test_expect_success 'plain bare with GIT_WORK_TREE' '\n \tif (\n-\t\tunset GIT_DIR GIT_CONFIG\n+\t\tportable_unset GIT_DIR GIT_CONFIG &&\n \t\tmkdir plain-bare-2 &&\n \t\tcd plain-bare-2 &&\n \t\tGIT_WORK_TREE=$(pwd) git --bare init\n@@ -72,7 +72,7 @@ test_expect_success 'plain bare with GIT_WORK_TREE' '\n test_expect_success 'GIT_DIR bare' '\n \n \t(\n-\t\tunset GIT_CONFIG\n+\t\tportable_unset GIT_CONFIG &&\n \t\tmkdir git-dir-bare.git &&\n \t\tGIT_DIR=git-dir-bare.git git init\n \t) &&\n@@ -82,7 +82,7 @@ test_expect_success 'GIT_DIR bare' '\n test_expect_success 'init --bare' '\n \n \t(\n-\t\tunset GIT_DIR GIT_WORK_TREE GIT_CONFIG\n+\t\tportable_unset GIT_DIR GIT_WORK_TREE GIT_CONFIG &&\n \t\tmkdir init-bare.git &&\n \t\tcd init-bare.git &&\n \t\tgit init --bare\n@@ -93,7 +93,7 @@ test_expect_success 'init --bare' '\n test_expect_success 'GIT_DIR non-bare' '\n \n \t(\n-\t\tunset GIT_CONFIG\n+\t\tportable_unset GIT_CONFIG &&\n \t\tmkdir non-bare &&\n \t\tcd non-bare &&\n \t\tGIT_DIR=.git git init\n@@ -104,7 +104,7 @@ test_expect_success 'GIT_DIR non-bare' '\n test_expect_success 'GIT_DIR & GIT_WORK_TREE (1)' '\n \n \t(\n-\t\tunset GIT_CONFIG\n+\t\tportable_unset GIT_CONFIG &&\n \t\tmkdir git-dir-wt-1.git &&\n \t\tGIT_WORK_TREE=$(pwd) GIT_DIR=git-dir-wt-1.git git init\n \t) &&\n@@ -114,7 +114,7 @@ test_expect_success 'GIT_DIR & GIT_WORK_TREE (1)' '\n test_expect_success 'GIT_DIR & GIT_WORK_TREE (2)' '\n \n \tif (\n-\t\tunset GIT_CONFIG\n+\t\tportable_unset GIT_CONFIG &&\n \t\tmkdir git-dir-wt-2.git &&\n \t\tGIT_WORK_TREE=$(pwd) GIT_DIR=git-dir-wt-2.git git --bare init\n \t)\n@@ -127,7 +127,7 @@ test_expect_success 'GIT_DIR & GIT_WORK_TREE (2)' '\n test_expect_success 'reinit' '\n \n \t(\n-\t\tunset GIT_CONFIG GIT_WORK_TREE GIT_CONFIG\n+\t\tportable_unset GIT_CONFIG GIT_WORK_TREE GIT_CONFIG &&\n \n \t\tmkdir again &&\n \t\tcd again &&\n@@ -175,8 +175,8 @@ test_expect_success 'init with init.templatedir set' '\n \t\tgit config -f \"$test_config\"  init.templatedir \"${HOME}/templatedir-source\" &&\n \t\tmkdir templatedir-set &&\n \t\tcd templatedir-set &&\n-\t\tunset GIT_CONFIG_NOGLOBAL &&\n-\t\tunset GIT_TEMPLATE_DIR &&\n+\t\tportable_unset GIT_CONFIG_NOGLOBAL &&\n+\t\tportable_unset GIT_TEMPLATE_DIR &&\n \t\tNO_SET_GIT_TEMPLATE_DIR=t &&\n \t\texport NO_SET_GIT_TEMPLATE_DIR &&\n \t\tgit init\n@@ -187,7 +187,7 @@ test_expect_success 'init with init.templatedir set' '\n test_expect_success 'init --bare/--shared overrides system/global config' '\n \t(\n \t\ttest_config=\"$HOME\"/.gitconfig &&\n-\t\tunset GIT_CONFIG_NOGLOBAL &&\n+\t\tportable_unset GIT_CONFIG_NOGLOBAL &&\n \t\tgit config -f \"$test_config\" core.bare false &&\n \t\tgit config -f \"$test_config\" core.sharedRepository 0640 &&\n \t\tmkdir init-bare-shared-override &&\n@@ -202,7 +202,7 @@ test_expect_success 'init --bare/--shared overrides system/global config' '\n test_expect_success 'init honors global core.sharedRepository' '\n \t(\n \t\ttest_config=\"$HOME\"/.gitconfig &&\n-\t\tunset GIT_CONFIG_NOGLOBAL &&\n+\t\tportable_unset GIT_CONFIG_NOGLOBAL &&\n \t\tgit config -f \"$test_config\" core.sharedRepository 0666 &&\n \t\tmkdir shared-honor-global &&\n \t\tcd shared-honor-global &&\ndiff --git a/t/t7006-pager.sh b/t/t7006-pager.sh\nindex fb744e3..4c5da2e 100755\n--- a/t/t7006-pager.sh\n+++ b/t/t7006-pager.sh\n@@ -41,7 +41,7 @@ else\n fi\n \n test_expect_success 'setup' '\n-\tunset GIT_PAGER GIT_PAGER_IN_USE;\n+\tportable_unset GIT_PAGER GIT_PAGER_IN_USE &&\n \ttest_might_fail git config --unset core.pager &&\n \n \tPAGER=\"cat >paginated.out\" &&\n@@ -254,7 +254,7 @@ test_default_pager() {\n \tparse_args \"$@\"\n \n \t$test_expectation SIMPLEPAGERTTY \"$cmd - default pager is used by default\" \"\n-\t\tunset PAGER GIT_PAGER;\n+\t\tportable_unset PAGER GIT_PAGER &&\n \t\ttest_might_fail git config --unset core.pager &&\n \t\trm -f default_pager_used ||\n \t\tcleanup_fail &&\n@@ -277,7 +277,7 @@ test_PAGER_overrides() {\n \tparse_args \"$@\"\n \n \t$test_expectation TTY \"$cmd - PAGER overrides default pager\" \"\n-\t\tunset GIT_PAGER;\n+\t\tportable_unset GIT_PAGER &&\n \t\ttest_might_fail git config --unset core.pager &&\n \t\trm -f PAGER_used ||\n \t\tcleanup_fail &&\n@@ -305,7 +305,7 @@ test_core_pager() {\n \tparse_args \"$@\"\n \n \t$test_expectation TTY \"$cmd - repository-local core.pager setting $used_if_wanted\" \"\n-\t\tunset GIT_PAGER;\n+\t\tportable_unset GIT_PAGER &&\n \t\trm -f core.pager_used ||\n \t\tcleanup_fail &&\n \n@@ -333,7 +333,7 @@ test_pager_subdir_helper() {\n \tparse_args \"$@\"\n \n \t$test_expectation TTY \"$cmd - core.pager $used_if_wanted from subdirectory\" \"\n-\t\tunset GIT_PAGER;\n+\t\tportable_unset GIT_PAGER &&\n \t\trm -f core.pager_used &&\n \t\trm -fr sub ||\n \t\tcleanup_fail &&\ndiff --git a/t/t7502-commit.sh b/t/t7502-commit.sh\nindex b6b9802..028b101 100755\n--- a/t/t7502-commit.sh\n+++ b/t/t7502-commit.sh\n@@ -252,8 +252,8 @@ test_expect_success 'committer is automatic' '\n \n \techo >>negative &&\n \t(\n-\t\tunset GIT_COMMITTER_EMAIL\n-\t\tunset GIT_COMMITTER_NAME\n+\t\tportable_unset GIT_COMMITTER_EMAIL &&\n+\t\tportable_unset GIT_COMMITTER_NAME &&\n \t\t# must fail because there is no change\n \t\ttest_must_fail git commit -e -m \"sample\"\n \t) &&\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex d86edcd..b234c27 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -268,6 +268,17 @@ remove_cr () {\n \ttr '\\015' Q | sed -e 's/Q$//'\n }\n \n+# In some bourne shell implementations, the \"unset\" builtin returns\n+# nonzero status when a variable to be unset was not set in the first\n+# place.\n+#\n+# Use portable_unset when that should not be considered an error.\n+\n+portable_unset () {\n+\tunset \"$@\"\n+\treturn 0\n+}\n+\n test_tick () {\n \tif test -z \"${test_tick+set}\"\n \tthen\n-- \n1.7.3.1.66.gab790\n"},{"id":"152405","messageId":"20101003205615.GB22743@burratino","threadId":"25321","inReplyTo":"1286136014-7728-8-git-send-email-newren@gmail.com","subject":"Re: [PATCHv6 07/16] t3600 (rm): add lots of missing &&","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-03T20:56:15Z","receivedAt":"2010-10-03T20:56:15Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Elijah Newren wrote:\n>> On Sun, Oct 3, 2010 at 8:28 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n\n>>> Why not\n>>>        -       echo content > foo\n>>>        -       git add foo\n>>>        -       git commit -m foo\n>>>        +       echo content > foo &&\n>>>        +       git add foo &&\n>>>        +       git commit --allow-empty -m foo &&\n>>> ?\n>>\n>> What advantage does using these three commands have over 'git checkout\n>> HEAD -- foo'?  Perhaps I'm missing something, but I don't see it.\n>> It's three commands to one, and the tests don't depend on foo starting\n>> with contents of 'content'; just that foo matches HEAD to start.\n>\n> Is there an advantage of the three-command version I'm just missing\n\nWhat if the content of foo in HEAD were \"other content\"?  Then the test\nwould not be testing what it is supposed to.\n\nMaybe you would prefer something like this on top?  My only concern is\nto make sure the test is robust (even if people add new tests before\nthese without paying much attention) and easy to read.\n\nI suppose I am nitpicking excessively because I do not like to see\nregressions, even in out-of-the-way code like this.\n---\ndiff --git a/t/t3600-rm.sh b/t/t3600-rm.sh\nindex 9660ae0..ae469df 100755\n--- a/t/t3600-rm.sh\n+++ b/t/t3600-rm.sh\n@@ -7,6 +7,15 @@ test_description='Test of the various options to git rm.'\n \n . ./test-lib.sh\n \n+prepare_foo () {\n+\techo \"$1\" >foo &&\n+\tgit add foo &&\n+\tgit commit --allow-empty -m \"set HEAD to $1\" &&\n+\techo \"$2\" >foo &&\n+\tgit add foo &&\n+\techo \"$3\" >foo\n+}\n+\n # Setup some files to be removed, some with funny characters\n test_expect_success \\\n     'Initialize test directory' \\\n@@ -44,27 +53,18 @@ test_expect_success \\\n \n test_expect_success \\\n     'Test that git rm --cached foo succeeds if the index matches the file' \\\n-    'echo content > foo &&\n-     git add foo &&\n-     git commit -m foo &&\n-     echo \"other content\" > foo &&\n+    'prepare_foo content content \"other content\" &&\n      git rm --cached foo'\n \n test_expect_success \\\n     'Test that git rm --cached foo fails if the index matches neither the file nor HEAD' '\n-     git checkout HEAD -- foo &&\n-     echo \"other content\" > foo &&\n-     git add foo &&\n-     echo \"yet another content\" > foo &&\n+     prepare_foo content \"other content\" \"yet another content\" &&\n      test_must_fail git rm --cached foo\n '\n \n test_expect_success \\\n     'Test that git rm --cached -f foo works in case where --cached only did not' \\\n-    'git checkout HEAD -- foo &&\n-     echo \"other content\" > foo &&\n-     git add foo &&\n-     echo \"yet another content\" > foo &&\n+    'prepare_foo content \"other content\" \"yet another content\" &&\n      git rm --cached -f foo'\n \n test_expect_success \\\n-- \n"},{"id":"152406","messageId":"20101003205950.GC22743@burratino","threadId":"25321","inReplyTo":"1286136014-7728-16-git-send-email-newren@gmail.com","subject":"Re: [PATCHv6 15/16] Add missing &&'s throughout the testsuite","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-03T20:59:50Z","receivedAt":"2010-10-03T20:59:50Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Elijah Newren wrote:\n>> On Sun, Oct 3, 2010 at 8:46 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n\n>>>> --- a/t/t1509-root-worktree.sh\n>>>> +++ b/t/t1509-root-worktree.sh\n>>>> @@ -232,8 +232,8 @@ say \"auto bare gitdir\"\n>>>>\n>>>>  # DESTROYYYYY!!!!!\n>>>>  test_expect_success 'setup' '\n>>>> -     rm -rf /refs /objects /info /hooks\n>>>> -     rm /*\n>>>> +     rm -rf /refs /objects /info /hooks &&\n>>>> +     rm /* &&\n[...]\n>> How about replacing the two rm commands with a simple 'rm -rf /*'?\n\nUmm, won't that delete _everything_, including git?\n\nI would suggest just leaving the test alone and contacting the test\nauthor or adding a comment unless you can test the change.\n"},{"id":"152407","messageId":"20101003210913.GD22743@burratino","threadId":"25321","inReplyTo":"1286136014-7728-1-git-send-email-newren@gmail.com","subject":"Re: [PATCHv6 00/16] Add missing &&'s in the testsuite","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-03T21:09:13Z","receivedAt":"2010-10-03T21:09:13Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Elijah Newren wrote:\n\n> This patch series fixes many of the missing &&s in the testsuite.\n[...]\n>  100 files changed, 429 insertions(+), 418 deletions(-)\n\nThanks for your persistence, and sorry to nitpick so.\n\nWith the exception of patches 7 and 15 as already mentioned, this\nlooks ready to me.\n"},{"id":"152409","messageId":"20101003211752.GA24530@burratino","threadId":"25321","inReplyTo":"1286136014-7728-16-git-send-email-newren@gmail.com","subject":"Re: [PATCHv6 15/16] Add missing &&'s throughout the testsuite","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-03T21:17:52Z","receivedAt":"2010-10-03T21:17:52Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Elijah Newren wrote:\n\n> +++ b/t/t5550-http-fetch.sh\n> @@ -93,9 +93,7 @@ test_expect_success 'fetch notices corrupt idx' '\n>  '\n>  \n>  test_expect_success 'did not use upload-pack service' '\n> -\tgrep '/git-upload-pack' <\"$HTTPD_ROOT_PATH\"/access.log >act\n> -\t: >exp\n> -\ttest_cmp exp act\n> +\t! grep '/git-upload-pack' <\"$HTTPD_ROOT_PATH\"/access.log >act\n\nWait a moment: this writes its output to act instead of stdout,\nso one still does _not_ get to see the output when debugging\nwith -v.\n\nProbably the nontrivial changes (this one and adding a SYMLINKS\nprereq) should be split off as separate patches or mentioned in\nthe log message?\n\nPro tip: if all that remains is tiny tweaks like these, you can\nprobably ask Junio to amend instead of resending everything. :)\n"},{"id":"152431","messageId":"7vmxquettf.fsf@alter.siamese.dyndns.org","threadId":"25321","inReplyTo":"20101003205615.GB22743@burratino","subject":"Re: [PATCHv6 07/16] t3600 (rm): add lots of missing &&","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-10-03T23:32:28Z","receivedAt":"2010-10-03T23:32:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> Maybe you would prefer something like this on top?  My only concern is\n> to make sure the test is robust (even if people add new tests before\n> these without paying much attention) and easy to read.\n>\n> I suppose I am nitpicking excessively because I do not like to see\n> regressions, even in out-of-the-way code like this.\n\nI do not think you are nitpicking at all; it is a key to maintainability\nto make sure that the code is unlikely to be broken by future changes that\nare not perfectly diligent.\n\nThanks.\n"},{"id":"152439","messageId":"7vfwwmdbgl.fsf@alter.siamese.dyndns.org","threadId":"25321","inReplyTo":"1286136014-7728-2-git-send-email-newren@gmail.com","subject":"Re: [PATCHv6 01/16] test-lib: make test_expect_code a test command","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-10-04T00:54:18Z","receivedAt":"2010-10-04T00:54:18Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Elijah Newren <newren@gmail.com> writes:\n\n> diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\n> index f688bd3..c2f5f8d 100755\n> --- a/t/t0000-basic.sh\n> +++ b/t/t0000-basic.sh\n> @@ -130,22 +130,57 @@ test_expect_success 'tests clean up after themselves' '\n> ...\n> +#!$SHELL_PATH\n> +\n> +test_description='Failing tests with cleanup commands'\n> +\n> +# Point to the t/test-lib.sh, which isn't in ../ as usual\n> +TEST_DIRECTORY=\\\"$TEST_DIRECTORY\\\"\n\nDo we know at this point that the string in $TEST_DIRECTORY can safely be\nquoted by just a simple dq pair?  I don't think so--isn't the leading part\nof that string whatever the user can choose (i.e. $(cwd))?\n\nThis seems sloppy.\n\n> +. \\\"\\$TEST_DIRECTORY\\\"/test-lib.sh\n\nOnce you get the right value in TEST_DIRECTORY, this one is correct.\n"},{"id":"152440","messageId":"7v8w2edbd2.fsf@alter.siamese.dyndns.org","threadId":"25321","inReplyTo":"1286136014-7728-3-git-send-email-newren@gmail.com","subject":"Re: [PATCHv6 02/16] t3020 (ls-files-error-unmatch): remove stray '1' from end of file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-10-04T00:56:25Z","receivedAt":"2010-10-04T00:56:25Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks; I'll take this to 'maint' outside the context of this series, so\nwe will have one less patch we have in the review ;-)\n"},{"id":"152445","messageId":"AANLkTi=+N=jm1b3vpiwxR0tFwPGbsaJyEq39q3oAyAn_@mail.gmail.com","threadId":"25321","inReplyTo":"1286136014-7728-1-git-send-email-newren@gmail.com","subject":"Re: [PATCHv6 00/16] Add missing &&'s in the testsuite","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-10-04T03:11:13Z","receivedAt":"2010-10-04T03:11:13Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sun, Oct 3, 2010 at 19:59, Elijah Newren <newren@gmail.com> wrote:\n\n>    * In patch 1, I made two of the changes suggested by Jonathan, but\n>      this was Ævar's patch so he may want to comment on those.  Also,\n>      Jonathan had a few extra questions in the last round that\n>      perhaps Ævar may want to comment on.\n\nSince Jonathan says all but 7 & 15 are OK (and I looked at those) I\nassume I don't need to hunt down some other discussion and comment on\nthat. I.e. unless someone replies here.\n"},{"id":"152447","messageId":"AANLkTinU_fv7pJqw_ghM4RoF6dsiV8PFM3GgCqD-hh7L@mail.gmail.com","threadId":"25321","inReplyTo":"1286136014-7728-17-git-send-email-newren@gmail.com","subject":"Re: [PATCHv6 16/16] Introduce portable_unset and use it to ensure proper && chaining","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-10-04T03:26:58Z","receivedAt":"2010-10-04T03:26:58Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sun, Oct 3, 2010 at 20:00, Elijah Newren <newren@gmail.com> wrote:\n> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n> Signed-off-by: Elijah Newren <newren@gmail.com>\n> ---\n>  t/README          |   13 +++++--------\n>  t/t0001-init.sh   |   28 ++++++++++++++--------------\n>  t/t7006-pager.sh  |   10 +++++-----\n>  t/t7502-commit.sh |    4 ++--\n>  t/test-lib.sh     |   11 +++++++++++\n>  5 files changed, 37 insertions(+), 29 deletions(-)\n>\n> diff --git a/t/README b/t/README\n> index ee4c0cf..e10c0ce 100644\n> --- a/t/README\n> +++ b/t/README\n> @@ -259,14 +259,11 @@ Do:\n>        test ...\n>\n>    That way all of the commands in your tests will succeed or fail. If\n> -   you must ignore the return value of something (e.g., the return\n> -   after unsetting a variable that was already unset is unportable) it's\n> -   best to indicate so explicitly with a semicolon:\n> -\n> -       unset HLAGH;\n> -       git merge hla &&\n> -       git push gh &&\n> -       test ...\n> +   you must ignore the return value of something, consider using a\n> +   helper function (e.g. use portable_unset instead of unset, in order\n> +   to avoid unportable return value for unsetting a variable that was\n> +   already unset), or prepending the command with test_might_fail or\n> +   test_must_fail.\n\nThis should be:\n\n    diff --git a/t/README b/t/README\n    index a1eb7c8..dc4b9d1 100644\n    --- a/t/README\n    +++ b/t/README\n    @@ -259,11 +259,10 @@ Do:\n            test ...\n\n        That way all of the commands in your tests will succeed or fail. If\n    -   you must ignore the return value of something (e.g., the return\n    -   after unsetting a variable that was already unset is unportable) it's\n    -   best to indicate so explicitly with a semicolon:\n    +   you must ignore the return value of something it's best to indicate\n    +   so explicitly with a test_might_fail:\n\n    -       unset HLAGH;\n    +       test_might_fail some-command &&\n            git merge hla &&\n            git push gh &&\n            test ...\n    @@ -522,6 +521,10 @@ library for your script to use.\n                    ...\n            '\n\n    + - portable_unset <variable>\n    +\n    +   .....\n    +\n     Prerequisites\n     -------------\n\nOr something like that. I don't know if we came to an agreement on\nusing test_might_fail for non-builtins, but the docs on do's & dont's\nshould mention how to do that, and portable_unset should be documented\nin a new section in \"Test harness library\".\n"},{"id":"152448","messageId":"AANLkTi=4_KN858sfXy59xgUSTCtj9ZkvW3+MrX3w3wWg@mail.gmail.com","threadId":"25321","inReplyTo":"1286136014-7728-2-git-send-email-newren@gmail.com","subject":"Re: [PATCHv6 01/16] test-lib: make test_expect_code a test command","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-10-04T03:37:16Z","receivedAt":"2010-10-04T03:37:16Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sun, Oct 3, 2010 at 19:59, Elijah Newren <newren@gmail.com> wrote:\n> From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n>\n> Change test_expect_code to be a normal test command instead of a\n> top-level command.\n\n> [...]\n\n> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> Acked-by: Jonathan Nieder <jrnieder@gmail.com>\n> Signed-off-by: Elijah Newren <newren@gmail.com>\n> ---\n>  t/README                |   16 +++++++------\n>  t/t0000-basic.sh        |   55 ++++++++++++++++++++++++++++++++++++++--------\n>  t/t1504-ceiling-dirs.sh |    5 ++-\n>  t/t6020-merge-df.sh     |    4 ++-\n>  t/test-lib.sh           |   40 ++++++++++++++++++---------------\n>  5 files changed, 82 insertions(+), 38 deletions(-)\n\nThis doc change looks. Here's the diff against my patch for reference:\n\n    diff --git a/t/README b/t/README\n    index c216e8c..ee4c0cf 100644\n    --- a/t/README\n    +++ b/t/README\n    @@ -475,10 +475,10 @@ library for your script to use.\n                'Perl API' \\\n                \"$PERL_PATH\" \"$TEST_DIRECTORY\"/t9700/test.pl\n\n    - - test_expect_code <exit-code> <git-command>\n    + - test_expect_code <exit-code> <command>\n\n    -   Run a git command and ensure that it exits with the given exit\n    -   code. For example:\n    +   Run a command and ensure that it exits with the given exit code.\n    +   For example:\n\n            test_expect_success 'Merge with d/f conflicts' '\n                    test_expect_code 1 git merge \"merge msg\" B master\n"},{"id":"152449","messageId":"20101004034446.GA24884@burratino","threadId":"25321","inReplyTo":"AANLkTi=+N=jm1b3vpiwxR0tFwPGbsaJyEq39q3oAyAn_@mail.gmail.com","subject":"Re: [PATCHv6 00/16] Add missing &&'s in the testsuite","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-04T03:44:46Z","receivedAt":"2010-10-04T03:44:46Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Ævar,\n\nÆvar Arnfjörð Bjarmason wrote:\n\n> Since Jonathan says all but 7 & 15 are OK (and I looked at those) I\n> assume I don't need to hunt down some other discussion and comment on\n> that. I.e. unless someone replies here.\n\nIf you find time, it would be nice to take a look at\nhttp://thread.gmane.org/gmane.comp.version-control.git/157827/focus=157874\n(concerning patch 1/16), to consider quoting issues.\n\nBecause of all the nested quoting (and funny indentation, too), I\nfound the test hard to read.  Probably the best long-term solution\nwould be to use something like the style[1] notmuch’s test suite uses.\n\nI can only see problems coming from this if the path to the test\ndirectory has shell metacharacters (especially '$') in it, which would\nseem to me to be a pretty unusual setup.\n\n[1] or as Jeff suggested recently:\n\ntest_start 'setup'\ncat >expect <<EOF\n... whatever ...\nEOF\ntest_end success\n\ntest_start 'description'\ngit frob >actual &&\ntest_cmp expect actual\ntest_end success\n\nhttp://thread.gmane.org/gmane.comp.version-control.git/155596/focus=155681\n"},{"id":"152450","messageId":"AANLkTinVvmJMEDhPcxa_CiOL2_RsYBdo-JywXi2gKeYp@mail.gmail.com","threadId":"25321","inReplyTo":"7vfwwmdbgl.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCHv6 01/16] test-lib: make test_expect_code a test command","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-10-04T03:48:43Z","receivedAt":"2010-10-04T03:48:43Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Oct 4, 2010 at 00:54, Junio C Hamano <gitster@pobox.com> wrote:\n> Elijah Newren <newren@gmail.com> writes:\n>\n>> diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\n>> index f688bd3..c2f5f8d 100755\n>> --- a/t/t0000-basic.sh\n>> +++ b/t/t0000-basic.sh\n>> @@ -130,22 +130,57 @@ test_expect_success 'tests clean up after themselves' '\n>> ...\n>> +#!$SHELL_PATH\n>> +\n>> +test_description='Failing tests with cleanup commands'\n>> +\n>> +# Point to the t/test-lib.sh, which isn't in ../ as usual\n>> +TEST_DIRECTORY=\\\"$TEST_DIRECTORY\\\"\n>\n> Do we know at this point that the string in $TEST_DIRECTORY can safely be\n> quoted by just a simple dq pair?  I don't think so--isn't the leading part\n> of that string whatever the user can choose (i.e. $(cwd))?\n>\n> This seems sloppy.\n>\n>> +. \\\"\\$TEST_DIRECTORY\\\"/test-lib.sh\n>\n> Once you get the right value in TEST_DIRECTORY, this one is correct.\n\nWouldn't the issue you and Jonathan are talking about disappear with:\n\n    diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\n    index c2f5f8d..69e219b 100755\n    --- a/t/t0000-basic.sh\n    +++ b/t/t0000-basic.sh\n    @@ -58,7 +58,7 @@ test_expect_failure 'pretend we have a known breakage' '\n     test_expect_success 'pretend we have fixed a known breakage (run\nin sub test-lib)' \"\n         mkdir passing-todo &&\n         (cd passing-todo &&\n    -    cat >passing-todo.sh <<EOF &&\n    +    cat >passing-todo.sh <<\\EOF &&\n     #!$SHELL_PATH\n\n     test_description='A passing TODO test\n    @@ -139,7 +139,7 @@ fi\n     test_expect_success 'tests clean up even on failures' \"\n         mkdir failing-cleanup &&\n         (cd failing-cleanup &&\n    -    cat >failing-cleanup.sh <<EOF &&\n    +    cat >failing-cleanup.sh <<\\EOF &&\n     #!$SHELL_PATH\n\n     test_description='Failing tests with cleanup commands'\n\nNote the change to passing-todo, that uses the same setup style.\n\nWith that the output of:\n\n    $ rm -rfv trash*; ./t0000-basic.sh --debug; cat trash\\\ndirectory.t0000-basic/{passing-todo,failing-cleanup}/*.sh\n\nIs now (cut):\n\n    # Point to the t/test-lib.sh, which isn't in ../ as usual\n    TEST_DIRECTORY=\"/home/avar/g/git/t\"\n    . \"$TEST_DIRECTORY\"/test-lib.sh\n\n    test_expect_failure 'pretend we have fixed a known breakage' '\n        :\n    '\n\n    test_done\n    #!/bin/sh\n\n    test_description='Failing tests with cleanup commands'\n\n    # Point to the t/test-lib.sh, which isn't in ../ as usual\n    TEST_DIRECTORY=\"/home/avar/g/git/t\"\n    . \"$TEST_DIRECTORY\"/test-lib.sh\n\nInstead of previously being:\n\n    # Point to the t/test-lib.sh, which isn't in ../ as usual\n    TEST_DIRECTORY=\"/home/avar/g/git/t\"\n    . \"/home/avar/g/git/t\"/test-lib.sh\n\n    test_expect_failure 'pretend we have fixed a known breakage' '\n        :\n    '\n\n    test_done\n    #!/bin/sh\n\n    test_description='Failing tests with cleanup commands'\n\n    # Point to the t/test-lib.sh, which isn't in ../ as usual\n    TEST_DIRECTORY=\"/home/avar/g/git/t\"\n    . \"/home/avar/g/git/t\"/test-lib.sh\n\nI.e. before the TEST_DIRECTORY was always expanded.\n"},{"id":"152452","messageId":"20101004035007.GB24884@burratino","threadId":"25321","inReplyTo":"AANLkTinVvmJMEDhPcxa_CiOL2_RsYBdo-JywXi2gKeYp@mail.gmail.com","subject":"Re: [PATCHv6 01/16] test-lib: make test_expect_code a test command","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-04T03:50:07Z","receivedAt":"2010-10-04T03:50:07Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> With that the output of:\n> \n>     $ rm -rfv trash*; ./t0000-basic.sh --debug; cat trash\\\n> directory.t0000-basic/{passing-todo,failing-cleanup}/*.sh\n> \n> Is now (cut):\n> \n>     # Point to the t/test-lib.sh, which isn't in ../ as usual\n>     TEST_DIRECTORY=\"/home/avar/g/git/t\"\n>     . \"$TEST_DIRECTORY\"/test-lib.sh\n\nEdge case: what if the path to the git directory contains a \"\ncharacter (for example because someone is trying to ensure\nthat git commands can cope with such a cwd)?\n\nI suspect the best thing would be to export TEST_DIRECTORY\ninstead of including it inline in the script.\n"},{"id":"152451","messageId":"AANLkTikcY=9pVq4upP0wt_YBtRKZsjyn7uHKyAonB+Nt@mail.gmail.com","threadId":"25321","inReplyTo":"20101004034446.GA24884@burratino","subject":"Re: [PATCHv6 00/16] Add missing &&'s in the testsuite","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-10-04T03:50:30Z","receivedAt":"2010-10-04T03:50:30Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Oct 4, 2010 at 03:44, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Hi Ævar,\n>\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> Since Jonathan says all but 7 & 15 are OK (and I looked at those) I\n>> assume I don't need to hunt down some other discussion and comment on\n>> that. I.e. unless someone replies here.\n>\n> If you find time, it would be nice to take a look at\n> http://thread.gmane.org/gmane.comp.version-control.git/157827/focus=157874\n> (concerning patch 1/16), to consider quoting issues.\n\nAh thanks. I just noticed that after having written that mail and\nreplied to it.\n"},{"id":"152453","messageId":"AANLkTi=7mrROAhFxNmF_cmU2OKKNuhsdTUVpHT+4Jg-Y@mail.gmail.com","threadId":"25321","inReplyTo":"20101004035007.GB24884@burratino","subject":"Re: [PATCHv6 01/16] test-lib: make test_expect_code a test command","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-10-04T04:04:09Z","receivedAt":"2010-10-04T04:04:09Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Oct 4, 2010 at 03:50, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> With that the output of:\n>>\n>>     $ rm -rfv trash*; ./t0000-basic.sh --debug; cat trash\\\n>> directory.t0000-basic/{passing-todo,failing-cleanup}/*.sh\n>>\n>> Is now (cut):\n>>\n>>     # Point to the t/test-lib.sh, which isn't in ../ as usual\n>>     TEST_DIRECTORY=\"/home/avar/g/git/t\"\n>>     . \"$TEST_DIRECTORY\"/test-lib.sh\n>\n> Edge case: what if the path to the git directory contains a \"\n> character (for example because someone is trying to ensure\n> that git commands can cope with such a cwd)?\n>\n> I suspect the best thing would be to export TEST_DIRECTORY\n> instead of including it inline in the script.\n\nWe could do that, but then you couldn't cd to the trash directory and\nmanually run the test without exporting the path to TEST_DIRECTORY\nagain.\n\nPersonally I care more about that sort of edge case that I actually\nrun into than someone testing Git under a crazy pathname.\n"},{"id":"152454","messageId":"20101004040623.GC24884@burratino","threadId":"25321","inReplyTo":"AANLkTi=7mrROAhFxNmF_cmU2OKKNuhsdTUVpHT+4Jg-Y@mail.gmail.com","subject":"Re: [PATCHv6 01/16] test-lib: make test_expect_code a test command","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-04T04:06:23Z","receivedAt":"2010-10-04T04:06:23Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n> On Mon, Oct 4, 2010 at 03:50, Jonathan Nieder <jrnieder@gmail.com> wrote:\n\n>> I suspect the best thing would be to export TEST_DIRECTORY\n>> instead of including it inline in the script.\n>\n> We could do that, but then you couldn't cd to the trash directory and\n> manually run the test without exporting the path to TEST_DIRECTORY\n> again.\n\nOkay, then how about:\n\n\t: ${TEST_DIRECTORY=$(cd ../.. && pwd)}\n\t. \"$TEST_DIRECTORY\"/test-lib.sh\n\ni.e., accepting TEST_DIRECTORY from the environment if and only\nif it is available?\n"},{"id":"152457","messageId":"20101004044402.GF24884@burratino","threadId":"25321","inReplyTo":"AANLkTinU_fv7pJqw_ghM4RoF6dsiV8PFM3GgCqD-hh7L@mail.gmail.com","subject":"Re: [PATCHv6 16/16] Introduce portable_unset and use it to ensure proper && chaining","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-04T04:44:02Z","receivedAt":"2010-10-04T04:44:02Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n>                         I don't know if we came to an agreement on\n> using test_might_fail for non-builtins\n\nNon-builtins: okay.\nNon-git commands: no.\n\nThat's just my take, though; if the project consensus is different,\nwho am I to resist it?\n\n> but the docs on do's & dont's\n> should mention how to do that\n\nIs it common to need to do\n\n\t{\n\t\tgrep dontknowifitwillmatch file >result ||\n\t\ttrue\n\t}\n\nfor commands other than unset?  If so, then I guess we should adopt\nSverre's cmd_might_fail to make it less noisy, anyway.\n\n> and portable_unset should be documented\n> in a new section in \"Test harness library\".\n\nYes, that sounds good.\n"},{"id":"152473","messageId":"AANLkTink3gPGVGXnO2j1cvfHShPG1Lq23eeY6m+7b1bK@mail.gmail.com","threadId":"25321","inReplyTo":"20101004040623.GC24884@burratino","subject":"Re: [PATCHv6 01/16] test-lib: make test_expect_code a test command","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-10-04T06:57:55Z","receivedAt":"2010-10-04T06:57:55Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Oct 4, 2010 at 04:06, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n>> On Mon, Oct 4, 2010 at 03:50, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>\n>>> I suspect the best thing would be to export TEST_DIRECTORY\n>>> instead of including it inline in the script.\n>>\n>> We could do that, but then you couldn't cd to the trash directory and\n>> manually run the test without exporting the path to TEST_DIRECTORY\n>> again.\n>\n> Okay, then how about:\n>\n>        : ${TEST_DIRECTORY=$(cd ../.. && pwd)}\n>        . \"$TEST_DIRECTORY\"/test-lib.sh\n>\n> i.e., accepting TEST_DIRECTORY from the environment if and only\n> if it is available?\n\nMaybe, if someone thinks it's worthwhile.\n\nOn the other hand I just tested git in a path called /tmp/\\\\\"\\\\/git/t\nand found that every single one of our tests fail. So I think it would\nbe better to just leave this as it is (but maybe apply the <<\\EOF\npatch on top) and tackle the issue of the entire test suite breaking\nunder insane path names in some later patch.\n\nI don't see the point spending time fixing it here if nothing else\nworks with crazy pathnames like these.\n"},{"id":"152486","messageId":"7vy6ae8kdi.fsf@alter.siamese.dyndns.org","threadId":"25321","inReplyTo":"20101004044402.GF24884@burratino","subject":"Re: [PATCHv6 16/16] Introduce portable_unset and use it to ensure proper && chaining","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-10-04T07:52:57Z","receivedAt":"2010-10-04T07:52:57Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>>                         I don't know if we came to an agreement on\n>> using test_might_fail for non-builtins\n>\n> Non-builtins: okay.\n> Non-git commands: no.\n>\n> That's just my take, though; if the project consensus is different,\n> who am I to resist it?\n\nHmm, the pros and cons between allowing test_might_fail on normal commands\nvs introducing cmd_might_fail are questionable, though.  I cannot think of\na case where we would want to tolerate death by signal or segv on non git\ncommands by using cmd_might_fail.  At least I do not think that is a\ncommon thing we would want to ignore, and in a rare case, it probably is a\ngood idea to say that explicitly with something like...\n\n\t{\n        \tfrotz\n                : the above might randomly segfault but we do not care\n\t}\n"},{"id":"152500","messageId":"20101004092830.GM24884@burratino","threadId":"25321","inReplyTo":"AANLkTink3gPGVGXnO2j1cvfHShPG1Lq23eeY6m+7b1bK@mail.gmail.com","subject":"Re: [PATCHv6 01/16] test-lib: make test_expect_code a test command","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-04T09:28:30Z","receivedAt":"2010-10-04T09:28:30Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> On the other hand I just tested git in a path called /tmp/\\\\\"\\\\/git/t\n\nI tried /tmp/test\"git and tests other than t0000.5 seem to work fine.\n\n> and found that every single one of our tests fail.\n\nEvery test script, not every test, right?\n\nThat's a makefile bug, I think: the bin-wrappers/% rule does not\nsed-quote the working directory before passing it to sed.  After\nworking around that with GIT_TEST_OPTS=--with-dashes, tests are\nrunning without trouble.\n\nI don't think these edge cases are particularly important, but I\ndo think it's better to make sure code that takes care of the edge\ncases when it's easy.\n"},{"id":"152516","messageId":"20101004113838.GF4738@burratino","threadId":"25321","inReplyTo":"7vy6ae8kdi.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCHv6 16/16] Introduce portable_unset and use it to ensure proper && chaining","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-04T11:38:38Z","receivedAt":"2010-10-04T11:38:38Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n\n> Hmm, the pros and cons between allowing test_might_fail on normal commands\n> vs introducing cmd_might_fail are questionable, though.  I cannot think of\n> a case where we would want to tolerate death by signal or segv on non git\n> commands\n\nOkay, makes sense.  I would be happier if exit statuses 129 and 129-256\nwere disallowed by test_must_fail, too, but that does not make it any\nless useful for cases like \"test_might_fail grep needle haystack >result\".\nAnd it is better to avoid introducing yet another command to learn.\n"},{"id":"299183","messageId":"1286195329038-5598912.post@n2.nabble.com","threadId":"25321","inReplyTo":"1286136014-7728-1-git-send-email-newren@gmail.com","subject":"Re: [PATCHv6 00/16] Add missing &&'s in the testsuite","fromName":"yj2133011","fromEmail":"274040551@qq.com","sentAt":"2010-10-04T12:28:49Z","receivedAt":"2010-10-04T12:28:49Z","isPatch":false,"sender":{"key":"274040551@qq.com","avatar":null},"body":"\nWrite good cheer, host.\n\n\n--------------------------------------------------------\nThis \nhttp://www.tomtop.com/black-remote-controller-charger2x-2800mah-battery-packs-for-wii_p11124.html?aid=z\nWii Charger  looks good n stylish. It lights up all blue which made me think\nthis is good. Get a \nhttp://www.tomtop.com/mini-bluetooth-keyboard-for-ps3-mac-os-android-pc-pda.html?aid=z\nWireless Keyboard  and mouse combo for your computer workstation and reduce\ndesktop clutter.\n\n-----\nThe voice input and output is very good in this \nhttp://www.tomtop.com/black-ps3-wireless-bluetooth-headset-for-playstation-3.html?aid=z\nWireless PS3 Headset . It is compatible with all PS3 games.Buy from Reliable \nhttp://www.tomtop.com/google-android-7-notebook-3g-tablet-pc-umpc-wifi-mid-pda.html?aid=z\nGoogle Android PC  apad Wholesalers.\n-- \nView this message in context: http://git.661346.n2.nabble.com/PATCHv6-00-16-Add-missing-s-in-the-testsuite-tp5596961p5598912.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"152742","messageId":"20101006053118.GA29289@burratino","threadId":"25321","inReplyTo":"1286136014-7728-1-git-send-email-newren@gmail.com","subject":"[TOY PATCH] test-lib: &&-chaining tester","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-06T05:31:18Z","receivedAt":"2010-10-06T05:31:18Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nHi Elijah,\n\nElijah Newren wrote:\n\n> This patch series fixes many of the missing &&s in the testsuite.\n\nThanks again.  Here's a little glimpse of a future without missing &&s\nto play with.\n\n t/test-lib.sh |   11 +++++++++++\n 1 files changed, 11 insertions(+), 0 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 932f45b..e3a0e68 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -393,7 +393,17 @@ test_debug () {\n \ttest \"$debug\" = \"\" || eval \"$1\"\n }\n \n+check_command_chaining_ () {\n+\teval >&3 2>&4 \"(exit 189) && $1\"\n+\teval_chain_ret=$?\n+\tif test \"$eval_chain_ret\" != 189\n+\tthen\n+\t\terror 'bug in the test script: missing \"&&\" in test commands'\n+\tfi\n+}\n+\n test_run_ () {\n+\tcheck_command_chaining_ \"$1\"\n \ttest_cleanup=:\n \teval >&3 2>&4 \"$1\"\n \teval_ret=$?\n@@ -697,6 +707,7 @@ test_cmp() {\n # the test to pass.\n \n test_when_finished () {\n+\tcheck_command_chaining_ \"$test_cleanup\"\n \ttest_cleanup=\"{ $*\n \t\t} && (exit \\\"\\$eval_ret\\\"); eval_ret=\\$?; $test_cleanup\"\n }\n-- \n1.7.2.3\n"},{"id":"152747","messageId":"vpqeic3agk8.fsf@bauges.imag.fr","threadId":"25321","inReplyTo":"20101006053118.GA29289@burratino","subject":"Re: [TOY PATCH] test-lib: &&-chaining tester","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2010-10-06T08:09:11Z","receivedAt":"2010-10-06T08:09:11Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> Elijah Newren wrote:\n>\n>> This patch series fixes many of the missing &&s in the testsuite.\n>\n> Thanks again.  Here's a little glimpse of a future without missing &&s\n> to play with.\n\nProbably a silly question, but is there any reason why we use these &&\ninstead of a \"set -e\" once and for all?\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"152750","messageId":"4CAC325D.1010403@viscovery.net","threadId":"25321","inReplyTo":"vpqeic3agk8.fsf@bauges.imag.fr","subject":"Re: [TOY PATCH] test-lib: &&-chaining tester","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2010-10-06T08:25:01Z","receivedAt":"2010-10-06T08:25:01Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 10/6/2010 10:09, schrieb Matthieu Moy:\n> Probably a silly question, but is there any reason why we use these &&\n> instead of a \"set -e\" once and for all?\n\nBecause different shells implement different behavior when \"set -e\" is in\neffect and functions, && and || chains, and traps are in the game.\n\n-- Hannes\n"},{"id":"152752","messageId":"AANLkTimU_OT+r8MMYHQ901r09H=Co+8dfjDD+0M0pF8s@mail.gmail.com","threadId":"25321","inReplyTo":"20101006053118.GA29289@burratino","subject":"Re: [TOY PATCH] test-lib: &&-chaining tester","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2010-10-06T08:52:59Z","receivedAt":"2010-10-06T08:52:59Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Wed, Oct 6, 2010 at 07:31, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Thanks again.  Here's a little glimpse of a future without missing &&s\n> to play with.\n\nInteresting! Are there any false positives? Did you run it and find\nany missing &&'s?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"154858","messageId":"20101031014654.GC29456@burratino","threadId":"25321","inReplyTo":"1286136014-7728-16-git-send-email-newren@gmail.com","subject":"[PATCH en/cascade-tests] tests: add missing &&","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-31T01:46:54Z","receivedAt":"2010-10-31T01:46:54Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Breaks in a test assertion's && chain can potentially hide\nfailures from earlier commands in the chain.\n\nCommands intended to fail should be marked with !, test_must_fail, or\ntest_might_fail.  The examples in this patch do not require that.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nHi,\n\nJust found some time to work through reports from the && checker.\nThe examples below only add && to the end of lines in various tests.\nPasses all tests there (though of course that does not mean much).\n\nThoughts?\n\nJonathan\n\n t/annotate-tests.sh                         |    2 +-\n t/t0003-attributes.sh                       |    2 +-\n t/t0024-crlf-archive.sh                     |    4 ++--\n t/t0026-eol-config.sh                       |    2 +-\n t/t0050-filesystem.sh                       |   12 ++++++------\n t/t1000-read-tree-m-3way.sh                 |    2 +-\n t/t1001-read-tree-m-2way.sh                 |    2 +-\n t/t1011-read-tree-sparse-checkout.sh        |    2 +-\n t/t1200-tutorial.sh                         |    2 +-\n t/t1302-repo-version.sh                     |    2 +-\n t/t1401-symbolic-ref.sh                     |    2 +-\n t/t1402-check-ref-format.sh                 |    4 ++--\n t/t1410-reflog.sh                           |    8 ++++----\n t/t1450-fsck.sh                             |    4 ++--\n t/t2007-checkout-symlink.sh                 |    2 +-\n t/t2016-checkout-patch.sh                   |    2 +-\n t/t2017-checkout-orphan.sh                  |    2 +-\n t/t2050-git-dir-relative.sh                 |    4 ++--\n t/t2101-update-index-reupdate.sh            |    2 +-\n t/t2200-add-update.sh                       |    2 +-\n t/t3001-ls-files-others-exclude.sh          |    2 +-\n t/t3030-merge-recursive.sh                  |    2 +-\n t/t3050-subprojects-fetch.sh                |    4 ++--\n t/t3203-branch-output.sh                    |    6 +++---\n t/t3300-funny-names.sh                      |    8 ++++----\n t/t3307-notes-man.sh                        |    2 +-\n t/t3406-rebase-message.sh                   |    6 +++---\n t/t3408-rebase-multi-line.sh                |    2 +-\n t/t3412-rebase-root.sh                      |    4 ++--\n t/t3415-rebase-autosquash.sh                |    6 +++---\n t/t3417-rebase-whitespace-fix.sh            |    2 +-\n t/t3504-cherry-pick-rerere.sh               |    4 ++--\n t/t3902-quoted.sh                           |    6 +++---\n t/t3903-stash.sh                            |    6 +++---\n t/t3904-stash-patch.sh                      |    2 +-\n t/t4008-diff-break-rewrite.sh               |    2 +-\n t/t4015-diff-whitespace.sh                  |    2 +-\n t/t4021-format-patch-numbered.sh            |    2 +-\n t/t4027-diff-submodule.sh                   |    8 ++++----\n t/t4034-diff-words.sh                       |    4 ++--\n t/t4103-apply-binary.sh                     |    8 ++++----\n t/t4111-apply-subdir.sh                     |    4 ++--\n t/t4119-apply-config.sh                     |    2 +-\n t/t4127-apply-same-fn.sh                    |   18 +++++++++---------\n t/t4130-apply-criss-cross-rename.sh         |    2 +-\n t/t4133-apply-filenames.sh                  |    8 ++++----\n t/t4134-apply-submodule.sh                  |    2 +-\n t/t4150-am.sh                               |    2 +-\n t/t4201-shortlog.sh                         |    2 +-\n t/t4202-log.sh                              |    4 ++--\n t/t4252-am-options.sh                       |    2 +-\n t/t5300-pack-object.sh                      |    2 +-\n t/t5301-sliding-window.sh                   |    4 ++--\n t/t5302-pack-index.sh                       |    2 +-\n t/t5500-fetch-pack.sh                       |    2 +-\n t/t5502-quickfetch.sh                       |    2 +-\n t/t5510-fetch.sh                            |    2 +-\n t/t5514-fetch-multiple.sh                   |    2 +-\n t/t5516-fetch-push.sh                       |    8 ++++----\n t/t5519-push-alternates.sh                  |    2 +-\n t/t5531-deep-submodule-push.sh              |    2 +-\n t/t556x_common                              |   24 ++++++++++++------------\n t/t6001-rev-list-graft.sh                   |    8 ++++----\n t/t6009-rev-list-parent.sh                  |    2 +-\n t/t6010-merge-base.sh                       |    2 +-\n t/t6024-recursive-merge.sh                  |    2 +-\n t/t6029-merge-subtree.sh                    |    2 +-\n t/t6030-bisect-porcelain.sh                 |    8 ++++----\n t/t6036-recursive-corner-cases.sh           |    2 +-\n t/t6040-tracking-info.sh                    |    2 +-\n t/t6050-replace.sh                          |    2 +-\n t/t7105-reset-patch.sh                      |    6 +++---\n t/t7509-commit.sh                           |    2 +-\n t/t7602-merge-octopus-many.sh               |    2 +-\n t/t7610-mergetool.sh                        |    2 +-\n t/t7810-grep.sh                             |    4 ++--\n t/t9104-git-svn-follow-parent.sh            |    2 +-\n t/t9123-git-svn-rebuild-with-rewriteroot.sh |    2 +-\n t/t9124-git-svn-dcommit-auto-props.sh       |    2 +-\n t/t9151-svn-mergeinfo.sh                    |   22 +++++++++++-----------\n t/t9300-fast-import.sh                      |    2 +-\n t/t9350-fast-export.sh                      |    2 +-\n t/t9400-git-cvsserver-server.sh             |    2 +-\n t/t9401-git-cvsserver-crlf.sh               |    2 +-\n 84 files changed, 166 insertions(+), 166 deletions(-)\n\ndiff --git a/t/annotate-tests.sh b/t/annotate-tests.sh\nindex 396b965..35353fa 100644\n--- a/t/annotate-tests.sh\n+++ b/t/annotate-tests.sh\n@@ -38,7 +38,7 @@ test_expect_success \\\n     'prepare reference tree' \\\n     'echo \"1A quick brown fox jumps over the\" >file &&\n      echo \"lazy dog\" >>file &&\n-     git add file\n+     git add file &&\n      GIT_AUTHOR_NAME=\"A\" git commit -a -m \"Initial.\"'\n \n test_expect_success \\\ndiff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh\nindex de38c7f..7590b45 100755\n--- a/t/t0003-attributes.sh\n+++ b/t/t0003-attributes.sh\n@@ -59,7 +59,7 @@ test_expect_success 'attribute test' '\n \n test_expect_success 'attribute test: read paths from stdin' '\n \n-\tcat <<EOF > expect\n+\tcat <<EOF > expect &&\n f: test: f\n a/f: test: f\n a/c/f: test: f\ndiff --git a/t/t0024-crlf-archive.sh b/t/t0024-crlf-archive.sh\nindex c7d0324..ec6c1b3 100755\n--- a/t/t0024-crlf-archive.sh\n+++ b/t/t0024-crlf-archive.sh\n@@ -7,7 +7,7 @@ UNZIP=${UNZIP:-unzip}\n \n test_expect_success setup '\n \n-\tgit config core.autocrlf true\n+\tgit config core.autocrlf true &&\n \n \tprintf \"CRLF line ending\\r\\nAnd another\\r\\n\" > sample &&\n \tgit add sample &&\n@@ -20,7 +20,7 @@ test_expect_success setup '\n test_expect_success 'tar archive' '\n \n \tgit archive --format=tar HEAD |\n-\t( mkdir untarred && cd untarred && \"$TAR\" -xf - )\n+\t( mkdir untarred && cd untarred && \"$TAR\" -xf - ) &&\n \n \ttest_cmp sample untarred/sample\n \ndiff --git a/t/t0026-eol-config.sh b/t/t0026-eol-config.sh\nindex f37ac8f..fe0164b 100755\n--- a/t/t0026-eol-config.sh\n+++ b/t/t0026-eol-config.sh\n@@ -12,7 +12,7 @@ test_expect_success setup '\n \n \tgit config core.autocrlf false &&\n \n-\techo \"one text\" > .gitattributes\n+\techo \"one text\" > .gitattributes &&\n \n \tfor w in Hello world how are you; do echo $w; done >one &&\n \tfor w in I am very very fine thank you; do echo $w; done >two &&\ndiff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh\nindex 41df6bc..057c97c 100755\n--- a/t/t0050-filesystem.sh\n+++ b/t/t0050-filesystem.sh\n@@ -12,14 +12,14 @@ unibad=\n no_symlinks=\n test_expect_success 'see what we expect' '\n \n-\ttest_case=test_expect_success\n-\ttest_unicode=test_expect_success\n+\ttest_case=test_expect_success &&\n+\ttest_unicode=test_expect_success &&\n \tmkdir junk &&\n \techo good >junk/CamelCase &&\n \techo bad >junk/camelcase &&\n \tif test \"$(cat junk/CamelCase)\" != good\n \tthen\n-\t\ttest_case=test_expect_failure\n+\t\ttest_case=test_expect_failure &&\n \t\tcase_insensitive=t\n \tfi &&\n \trm -fr junk &&\n@@ -27,7 +27,7 @@ test_expect_success 'see what we expect' '\n \t>junk/\"$auml\" &&\n \tcase \"$(cd junk && echo *)\" in\n \t\"$aumlcdiar\")\n-\t\ttest_unicode=test_expect_failure\n+\t\ttest_unicode=test_expect_failure &&\n \t\tunibad=t\n \t\t;;\n \t*)\t;;\n@@ -36,7 +36,7 @@ test_expect_success 'see what we expect' '\n \t{\n \t\tln -s x y 2> /dev/null &&\n \t\ttest -h y 2> /dev/null ||\n-\t\tno_symlinks=1\n+\t\tno_symlinks=1 &&\n \t\trm -f y\n \t}\n '\n@@ -128,7 +128,7 @@ test_expect_success \"setup unicode normalization tests\" '\n   cd unicode &&\n   touch \"$aumlcdiar\" &&\n   git add \"$aumlcdiar\" &&\n-  git commit -m initial\n+  git commit -m initial &&\n   git tag initial &&\n   git checkout -b topic &&\n   git mv $aumlcdiar tmp &&\ndiff --git a/t/t1000-read-tree-m-3way.sh b/t/t1000-read-tree-m-3way.sh\nindex 4f17172..ca8a409 100755\n--- a/t/t1000-read-tree-m-3way.sh\n+++ b/t/t1000-read-tree-m-3way.sh\n@@ -309,7 +309,7 @@ test_expect_success \\\n test_expect_success \\\n     '6 - must not exist in O && !A && !B case' \"\n      rm -f .git/index DD &&\n-     echo DD >DD\n+     echo DD >DD &&\n      git update-index --add DD &&\n      test_must_fail git read-tree -m $tree_O $tree_A $tree_B\n \"\ndiff --git a/t/t1001-read-tree-m-2way.sh b/t/t1001-read-tree-m-2way.sh\nindex c28d790..680d992 100755\n--- a/t/t1001-read-tree-m-2way.sh\n+++ b/t/t1001-read-tree-m-2way.sh\n@@ -394,7 +394,7 @@ test_expect_success '-m references the correct modified tree' '\n \techo >file-a &&\n \techo >file-b &&\n \tgit add file-a file-b &&\n-\tgit commit -a -m \"test for correct modified tree\"\n+\tgit commit -a -m \"test for correct modified tree\" &&\n \tgit branch initial-mod &&\n \techo b >file-b &&\n \tgit commit -a -m \"B\" &&\ndiff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh\nindex 9a07de1..8cf1515 100755\n--- a/t/t1011-read-tree-sparse-checkout.sh\n+++ b/t/t1011-read-tree-sparse-checkout.sh\n@@ -47,7 +47,7 @@ test_expect_success 'read-tree without .git/info/sparse-checkout' '\n '\n \n test_expect_success 'read-tree with .git/info/sparse-checkout but disabled' '\n-\techo >.git/info/sparse-checkout\n+\techo >.git/info/sparse-checkout &&\n \tgit read-tree -m -u HEAD &&\n \tgit ls-files -t >result &&\n \ttest_cmp expected.swt result &&\ndiff --git a/t/t1200-tutorial.sh b/t/t1200-tutorial.sh\nindex ab55eda..bfa2c21 100755\n--- a/t/t1200-tutorial.sh\n+++ b/t/t1200-tutorial.sh\n@@ -42,7 +42,7 @@ test_expect_success 'git diff' '\n '\n \n test_expect_success 'tree' '\n-\ttree=$(git write-tree 2>/dev/null)\n+\ttree=$(git write-tree 2>/dev/null) &&\n \ttest 8988da15d077d4829fc51d8544c097def6644dbb = $tree\n '\n \ndiff --git a/t/t1302-repo-version.sh b/t/t1302-repo-version.sh\nindex a6bf1bf..0e47662 100755\n--- a/t/t1302-repo-version.sh\n+++ b/t/t1302-repo-version.sh\n@@ -39,7 +39,7 @@ test_expect_success 'gitdir selection on unsupported repo' '\n \t(\n \t\tcd test2 &&\n \t\tgit config core.repositoryformatversion >../actual\n-\t)\n+\t) &&\n \ttest_cmp expect actual\n '\n \ndiff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh\nindex 7fa5f5b..2c96551 100755\n--- a/t/t1401-symbolic-ref.sh\n+++ b/t/t1401-symbolic-ref.sh\n@@ -28,7 +28,7 @@ test_expect_success 'symbolic-ref refuses non-ref for HEAD' '\n reset_to_sane\n \n test_expect_success 'symbolic-ref refuses bare sha1' '\n-\techo content >file && git add file && git commit -m one\n+\techo content >file && git add file && git commit -m one &&\n \ttest_must_fail git symbolic-ref HEAD `git rev-parse HEAD`\n '\n reset_to_sane\ndiff --git a/t/t1402-check-ref-format.sh b/t/t1402-check-ref-format.sh\nindex 782e75d..1b0f82f 100755\n--- a/t/t1402-check-ref-format.sh\n+++ b/t/t1402-check-ref-format.sh\n@@ -32,7 +32,7 @@ test_expect_success \"check-ref-format --branch @{-1}\" '\n \tT=$(git write-tree) &&\n \tsha1=$(echo A | git commit-tree $T) &&\n \tgit update-ref refs/heads/master $sha1 &&\n-\tgit update-ref refs/remotes/origin/master $sha1\n+\tgit update-ref refs/remotes/origin/master $sha1 &&\n \tgit checkout master &&\n \tgit checkout origin/master &&\n \tgit checkout master &&\n@@ -47,7 +47,7 @@ test_expect_success 'check-ref-format --branch from subdir' '\n \tT=$(git write-tree) &&\n \tsha1=$(echo A | git commit-tree $T) &&\n \tgit update-ref refs/heads/master $sha1 &&\n-\tgit update-ref refs/remotes/origin/master $sha1\n+\tgit update-ref refs/remotes/origin/master $sha1 &&\n \tgit checkout master &&\n \tgit checkout origin/master &&\n \tgit checkout master &&\ndiff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh\nindex 25046c4..252fc82 100755\n--- a/t/t1410-reflog.sh\n+++ b/t/t1410-reflog.sh\n@@ -186,8 +186,8 @@ test_expect_success 'delete' '\n \ttest_tick &&\n \tgit commit -m tiger C &&\n \n-\tHEAD_entry_count=$(git reflog | wc -l)\n-\tmaster_entry_count=$(git reflog show master | wc -l)\n+\tHEAD_entry_count=$(git reflog | wc -l) &&\n+\tmaster_entry_count=$(git reflog show master | wc -l) &&\n \n \ttest $HEAD_entry_count = 5 &&\n \ttest $master_entry_count = 5 &&\n@@ -199,13 +199,13 @@ test_expect_success 'delete' '\n \ttest $HEAD_entry_count = $(git reflog | wc -l) &&\n \t! grep ox < output &&\n \n-\tmaster_entry_count=$(wc -l < output)\n+\tmaster_entry_count=$(wc -l < output) &&\n \n \tgit reflog delete HEAD@{1} &&\n \ttest $(($HEAD_entry_count -1)) = $(git reflog | wc -l) &&\n \ttest $master_entry_count = $(git reflog show master | wc -l) &&\n \n-\tHEAD_entry_count=$(git reflog | wc -l)\n+\tHEAD_entry_count=$(git reflog | wc -l) &&\n \n \tgit reflog delete master@{07.04.2005.15:15:00.-0700} &&\n \tgit reflog show master > output &&\ndiff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh\nindex 1be415e..bb01d5a 100755\n--- a/t/t1450-fsck.sh\n+++ b/t/t1450-fsck.sh\n@@ -61,7 +61,7 @@ test_expect_success 'object with bad sha1' '\n \tsha=$(echo blob | git hash-object -w --stdin) &&\n \told=$(echo $sha | sed \"s+^..+&/+\") &&\n \tnew=$(dirname $old)/ffffffffffffffffffffffffffffffffffffff &&\n-\tsha=\"$(dirname $new)$(basename $new)\"\n+\tsha=\"$(dirname $new)$(basename $new)\" &&\n \tmv .git/objects/$old .git/objects/$new &&\n \ttest_when_finished \"remove_object $sha\" &&\n \tgit update-index --add --cacheinfo 100644 $sha foo &&\n@@ -111,7 +111,7 @@ test_expect_success 'email with embedded > is not okay' '\n '\n \n test_expect_success 'tag pointing to nonexistent' '\n-\tcat >invalid-tag <<-\\EOF\n+\tcat >invalid-tag <<-\\EOF &&\n \tobject ffffffffffffffffffffffffffffffffffffffff\n \ttype commit\n \ttag invalid\ndiff --git a/t/t2007-checkout-symlink.sh b/t/t2007-checkout-symlink.sh\nindex a74ee22..e6f59f1 100755\n--- a/t/t2007-checkout-symlink.sh\n+++ b/t/t2007-checkout-symlink.sh\n@@ -17,7 +17,7 @@ test_expect_success SYMLINKS setup '\n \tgit branch side &&\n \n \techo goodbye >nitfol &&\n-\tgit add nitfol\n+\tgit add nitfol &&\n \ttest_tick &&\n \tgit commit -m \"master adds file nitfol\" &&\n \ndiff --git a/t/t2016-checkout-patch.sh b/t/t2016-checkout-patch.sh\nindex a463b13..9cd0ac4 100755\n--- a/t/t2016-checkout-patch.sh\n+++ b/t/t2016-checkout-patch.sh\n@@ -32,7 +32,7 @@ test_expect_success PERL 'git checkout -p' '\n '\n \n test_expect_success PERL 'git checkout -p with staged changes' '\n-\tset_state dir/foo work index\n+\tset_state dir/foo work index &&\n \t(echo n; echo y) | git checkout -p &&\n \tverify_saved_state bar &&\n \tverify_state dir/foo index index\ndiff --git a/t/t2017-checkout-orphan.sh b/t/t2017-checkout-orphan.sh\nindex 2d2f63f..0e3b858 100755\n--- a/t/t2017-checkout-orphan.sh\n+++ b/t/t2017-checkout-orphan.sh\n@@ -14,7 +14,7 @@ TEST_FILE=foo\n test_expect_success 'Setup' '\n \techo \"Initial\" >\"$TEST_FILE\" &&\n \tgit add \"$TEST_FILE\" &&\n-\tgit commit -m \"First Commit\"\n+\tgit commit -m \"First Commit\" &&\n \ttest_tick &&\n \techo \"State 1\" >>\"$TEST_FILE\" &&\n \tgit add \"$TEST_FILE\" &&\ndiff --git a/t/t2050-git-dir-relative.sh b/t/t2050-git-dir-relative.sh\nindex b7131d8..21f4659 100755\n--- a/t/t2050-git-dir-relative.sh\n+++ b/t/t2050-git-dir-relative.sh\n@@ -26,7 +26,7 @@ chmod +x .git/hooks/post-commit'\n \n test_expect_success 'post-commit hook used ordinarily' '\n echo initial >top &&\n-git add top\n+git add top &&\n git commit -m initial &&\n test -r \"${COMMIT_FILE}\"\n '\n@@ -45,7 +45,7 @@ test -r \"${COMMIT_FILE}\"\n rm -rf \"${COMMIT_FILE}\"\n \n test_expect_success 'post-commit-hook from sub dir' '\n-echo changed again >top\n+echo changed again >top &&\n cd subdir &&\n git --git-dir .git --work-tree .. add ../top &&\n git --git-dir .git --work-tree .. commit -m subcommit &&\ndiff --git a/t/t2101-update-index-reupdate.sh b/t/t2101-update-index-reupdate.sh\nindex 76ad7c3..c8bce8c 100755\n--- a/t/t2101-update-index-reupdate.sh\n+++ b/t/t2101-update-index-reupdate.sh\n@@ -51,7 +51,7 @@ test_expect_success 'update-index again' \\\n \techo hello world >dir1/file3 &&\n \techo goodbye people >file2 &&\n \tgit update-index --add file2 dir1/file3 &&\n-\techo hello everybody >file2\n+\techo hello everybody >file2 &&\n \techo happy >dir1/file3 &&\n \tgit update-index --again &&\n \tgit ls-files -s >current &&\ndiff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh\nindex 2ad2819..0692427 100755\n--- a/t/t2200-add-update.sh\n+++ b/t/t2200-add-update.sh\n@@ -25,7 +25,7 @@ test_expect_success setup '\n \techo initial >dir1/sub2 &&\n \techo initial >dir2/sub3 &&\n \tgit add check dir1 dir2 top foo &&\n-\ttest_tick\n+\ttest_tick &&\n \tgit commit -m initial &&\n \n \techo changed >check &&\ndiff --git a/t/t3001-ls-files-others-exclude.sh b/t/t3001-ls-files-others-exclude.sh\nindex 6d2f2b6..c8fe978 100755\n--- a/t/t3001-ls-files-others-exclude.sh\n+++ b/t/t3001-ls-files-others-exclude.sh\n@@ -156,7 +156,7 @@ test_expect_success 'trailing slash in exclude allows directory match (2)' '\n \n test_expect_success 'trailing slash in exclude forces directory match (1)' '\n \n-\t>two\n+\t>two &&\n \tgit ls-files --others --exclude=two/ >output &&\n \tgrep \"^two\" output\n \ndiff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh\nindex e66e550..20d4f11 100755\n--- a/t/t3030-merge-recursive.sh\n+++ b/t/t3030-merge-recursive.sh\n@@ -544,7 +544,7 @@ test_expect_success 'reset and bind merge' '\n \t\techo \"100644 $o0 0\tc\"\n \t\techo \"100644 $o1 0\td/e\"\n \t) >expected &&\n-\ttest_cmp expected actual\n+\ttest_cmp expected actual &&\n \n \tgit read-tree --prefix=z/ master &&\n \tgit ls-files -s >actual &&\ndiff --git a/t/t3050-subprojects-fetch.sh b/t/t3050-subprojects-fetch.sh\nindex 4261e96..2f5f41a 100755\n--- a/t/t3050-subprojects-fetch.sh\n+++ b/t/t3050-subprojects-fetch.sh\n@@ -10,10 +10,10 @@ test_expect_success setup '\n \t\tcd sub &&\n \t\tgit init &&\n \t\t>subfile &&\n-\t\tgit add subfile\n+\t\tgit add subfile &&\n \t\tgit commit -m \"subproject commit #1\"\n \t) &&\n-\t>mainfile\n+\t>mainfile &&\n \tgit add sub mainfile &&\n \ttest_tick &&\n \tgit commit -m \"superproject commit #1\"\ndiff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh\nindex 809d1c4..6028748 100755\n--- a/t/t3203-branch-output.sh\n+++ b/t/t3203-branch-output.sh\n@@ -12,13 +12,13 @@ test_expect_success 'make commits' '\n '\n \n test_expect_success 'make branches' '\n-\tgit branch branch-one\n+\tgit branch branch-one &&\n \tgit branch branch-two HEAD^\n '\n \n test_expect_success 'make remote branches' '\n-\tgit update-ref refs/remotes/origin/branch-one branch-one\n-\tgit update-ref refs/remotes/origin/branch-two branch-two\n+\tgit update-ref refs/remotes/origin/branch-one branch-one &&\n+\tgit update-ref refs/remotes/origin/branch-two branch-two &&\n \tgit symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/branch-one\n '\n \ndiff --git a/t/t3300-funny-names.sh b/t/t3300-funny-names.sh\nindex f39a261..5e29a05 100755\n--- a/t/t3300-funny-names.sh\n+++ b/t/t3300-funny-names.sh\n@@ -43,8 +43,8 @@ test_expect_success TABS_IN_FILENAMES 'git ls-files no-funny' \\\n \ttest_cmp expected current'\n \n test_expect_success TABS_IN_FILENAMES 'setup expect' '\n-t0=`git write-tree`\n-echo \"$t0\" >t0\n+t0=`git write-tree` &&\n+echo \"$t0\" >t0 &&\n \n cat > expected <<\\EOF\n just space\n@@ -69,8 +69,8 @@ test_expect_success TABS_IN_FILENAMES 'git ls-files -z with-funny' \\\n \ttest_cmp expected current'\n \n test_expect_success TABS_IN_FILENAMES 'setup expect' '\n-t1=`git write-tree`\n-echo \"$t1\" >t1\n+t1=`git write-tree` &&\n+echo \"$t1\" >t1 &&\n \n cat > expected <<\\EOF\n just space\ndiff --git a/t/t3307-notes-man.sh b/t/t3307-notes-man.sh\nindex 3269f2e..2ea3be6 100755\n--- a/t/t3307-notes-man.sh\n+++ b/t/t3307-notes-man.sh\n@@ -26,7 +26,7 @@ test_expect_success 'example 1: notes to add an Acked-by line' '\n '\n \n test_expect_success 'example 2: binary notes' '\n-\tcp \"$TEST_DIRECTORY\"/test4012.png .\n+\tcp \"$TEST_DIRECTORY\"/test4012.png . &&\n \tgit checkout B &&\n \tblob=$(git hash-object -w test4012.png) &&\n \tgit notes --ref=logo add -C \"$blob\" &&\ndiff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh\nindex 85fc7c4..506d37e 100755\n--- a/t/t3406-rebase-message.sh\n+++ b/t/t3406-rebase-message.sh\n@@ -43,20 +43,20 @@ test_expect_success 'rebase -m' '\n '\n \n test_expect_success 'rebase --stat' '\n-        git reset --hard start\n+        git reset --hard start &&\n         git rebase --stat master >diffstat.txt &&\n         grep \"^ fileX |  *1 +$\" diffstat.txt\n '\n \n test_expect_success 'rebase w/config rebase.stat' '\n-        git reset --hard start\n+        git reset --hard start &&\n         git config rebase.stat true &&\n         git rebase master >diffstat.txt &&\n         grep \"^ fileX |  *1 +$\" diffstat.txt\n '\n \n test_expect_success 'rebase -n overrides config rebase.stat config' '\n-        git reset --hard start\n+        git reset --hard start &&\n         git config rebase.stat true &&\n         git rebase -n master >diffstat.txt &&\n         ! grep \"^ fileX |  *1 +$\" diffstat.txt\ndiff --git a/t/t3408-rebase-multi-line.sh b/t/t3408-rebase-multi-line.sh\nindex 2062b85..6b84e60 100755\n--- a/t/t3408-rebase-multi-line.sh\n+++ b/t/t3408-rebase-multi-line.sh\n@@ -16,7 +16,7 @@ test_expect_success setup '\n \tgit commit -a -m \"A sample commit log message that has a long\n summary that spills over multiple lines.\n \n-But otherwise with a sane description.\"\n+But otherwise with a sane description.\" &&\n \n \tgit branch side &&\n \ndiff --git a/t/t3412-rebase-root.sh b/t/t3412-rebase-root.sh\nindex 5869061..086c91c 100755\n--- a/t/t3412-rebase-root.sh\n+++ b/t/t3412-rebase-root.sh\n@@ -173,14 +173,14 @@ EOF\n test_expect_success 'pre-rebase hook stops rebase' '\n \tgit checkout -b stops1 other &&\n \ttest_must_fail git rebase --root --onto master &&\n-\ttest \"z$(git symbolic-ref HEAD)\" = zrefs/heads/stops1\n+\ttest \"z$(git symbolic-ref HEAD)\" = zrefs/heads/stops1 &&\n \ttest 0 = $(git rev-list other...stops1 | wc -l)\n '\n \n test_expect_success 'pre-rebase hook stops rebase -i' '\n \tgit checkout -b stops2 other &&\n \ttest_must_fail git rebase --root --onto master &&\n-\ttest \"z$(git symbolic-ref HEAD)\" = zrefs/heads/stops2\n+\ttest \"z$(git symbolic-ref HEAD)\" = zrefs/heads/stops2 &&\n \ttest 0 = $(git rev-list other...stops2 | wc -l)\n '\n \ndiff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh\nindex 37cb89a..fd2184c 100755\n--- a/t/t3415-rebase-autosquash.sh\n+++ b/t/t3415-rebase-autosquash.sh\n@@ -26,7 +26,7 @@ test_auto_fixup() {\n \techo 1 >file1 &&\n \tgit add -u &&\n \ttest_tick &&\n-\tgit commit -m \"fixup! first\"\n+\tgit commit -m \"fixup! first\" &&\n \n \tgit tag $1 &&\n \ttest_tick &&\n@@ -55,7 +55,7 @@ test_auto_squash() {\n \techo 1 >file1 &&\n \tgit add -u &&\n \ttest_tick &&\n-\tgit commit -m \"squash! first\"\n+\tgit commit -m \"squash! first\" &&\n \n \tgit tag $1 &&\n \ttest_tick &&\n@@ -84,7 +84,7 @@ test_expect_success 'misspelled auto squash' '\n \techo 1 >file1 &&\n \tgit add -u &&\n \ttest_tick &&\n-\tgit commit -m \"squash! forst\"\n+\tgit commit -m \"squash! forst\" &&\n \tgit tag final-missquash &&\n \ttest_tick &&\n \tgit rebase --autosquash -i HEAD^^^ &&\ndiff --git a/t/t3417-rebase-whitespace-fix.sh b/t/t3417-rebase-whitespace-fix.sh\nindex 220a740..1fb3e49 100755\n--- a/t/t3417-rebase-whitespace-fix.sh\n+++ b/t/t3417-rebase-whitespace-fix.sh\n@@ -89,7 +89,7 @@ test_expect_success 'same, but do not remove trailing spaces' '\n \tgit config core.whitespace \"-blank-at-eol\" &&\n \tgit reset --hard HEAD^ &&\n \tcp third file && git add file && git commit -m third &&\n-\tgit rebase --whitespace=fix HEAD^^\n+\tgit rebase --whitespace=fix HEAD^^ &&\n \tgit diff --exit-code HEAD^:file expect-second &&\n \ttest_cmp file third\n '\ndiff --git a/t/t3504-cherry-pick-rerere.sh b/t/t3504-cherry-pick-rerere.sh\nindex f7b3518..e6a6481 100755\n--- a/t/t3504-cherry-pick-rerere.sh\n+++ b/t/t3504-cherry-pick-rerere.sh\n@@ -23,7 +23,7 @@ test_expect_success 'conflicting merge' '\n test_expect_success 'fixup' '\n \techo foo-dev >foo &&\n \tgit add foo && test_tick && git commit -q -m 4 &&\n-\tgit reset --hard HEAD^\n+\tgit reset --hard HEAD^ &&\n \techo foo-dev >expect\n '\n \n@@ -33,7 +33,7 @@ test_expect_success 'cherry-pick conflict' '\n '\n \n test_expect_success 'reconfigure' '\n-\tgit config rerere.enabled false\n+\tgit config rerere.enabled false &&\n \tgit reset --hard\n '\n \ndiff --git a/t/t3902-quoted.sh b/t/t3902-quoted.sh\nindex 7d49469..da82b65 100755\n--- a/t/t3902-quoted.sh\n+++ b/t/t3902-quoted.sh\n@@ -36,19 +36,19 @@ for_each_name () {\n test_expect_success TABS_IN_FILENAMES 'setup' '\n \n \tmkdir \"$FN\" &&\n-\tfor_each_name \"echo initial >\\\"\\$name\\\"\"\n+\tfor_each_name \"echo initial >\\\"\\$name\\\"\" &&\n \tgit add . &&\n \tgit commit -q -m Initial &&\n \n \tfor_each_name \"echo second >\\\"\\$name\\\"\" &&\n-\tgit commit -a -m Second\n+\tgit commit -a -m Second &&\n \n \tfor_each_name \"echo modified >\\\"\\$name\\\"\"\n \n '\n \n test_expect_success TABS_IN_FILENAMES 'setup expected files' '\n-cat >expect.quoted <<\\EOF\n+cat >expect.quoted <<\\EOF &&\n Name\n \"Name and a\\nLF\"\n \"Name and an\\tHT\"\ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex 903a122..6fd560c 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -157,7 +157,7 @@ EOF\n \n test_expect_success 'stash branch' '\n \techo foo > file &&\n-\tgit commit file -m first\n+\tgit commit file -m first &&\n \techo bar > file &&\n \techo bar2 > file2 &&\n \tgit add file2 &&\n@@ -255,7 +255,7 @@ test_expect_success 'stash rm and ignore' '\n \techo file >.gitignore &&\n \tgit stash save \"rm and ignore\" &&\n \ttest bar = \"$(cat file)\" &&\n-\ttest file = \"$(cat .gitignore)\"\n+\ttest file = \"$(cat .gitignore)\" &&\n \tgit stash apply &&\n \t! test -r file &&\n \ttest file = \"$(cat .gitignore)\"\n@@ -268,7 +268,7 @@ test_expect_success 'stash rm and ignore (stage .gitignore)' '\n \tgit add .gitignore &&\n \tgit stash save \"rm and ignore (stage .gitignore)\" &&\n \ttest bar = \"$(cat file)\" &&\n-\t! test -r .gitignore\n+\t! test -r .gitignore &&\n \tgit stash apply &&\n \t! test -r file &&\n \ttest file = \"$(cat .gitignore)\"\ndiff --git a/t/t3904-stash-patch.sh b/t/t3904-stash-patch.sh\nindex d1819ca..1e7193a 100755\n--- a/t/t3904-stash-patch.sh\n+++ b/t/t3904-stash-patch.sh\n@@ -20,7 +20,7 @@ test_expect_success PERL 'setup' '\n # note: bar sorts before dir, so the first 'n' is always to skip 'bar'\n \n test_expect_success PERL 'saying \"n\" does nothing' '\n-\tset_state dir/foo work index\n+\tset_state dir/foo work index &&\n \t(echo n; echo n) | test_must_fail git stash save -p &&\n \tverify_state dir/foo work index &&\n \tverify_saved_state bar\ndiff --git a/t/t4008-diff-break-rewrite.sh b/t/t4008-diff-break-rewrite.sh\nindex e19ca65..d79d9e1e 100755\n--- a/t/t4008-diff-break-rewrite.sh\n+++ b/t/t4008-diff-break-rewrite.sh\n@@ -155,7 +155,7 @@ test_expect_success \\\n      git checkout-index -f -u -a &&\n      sed -e \"s/git/GIT/\" file0 >file1 &&\n      sed -e \"s/git/GET/\" file0 >file2 &&\n-     rm -f file0\n+     rm -f file0 &&\n      git update-index --add --remove file0 file1 file2'\n \n test_expect_success \\\ndiff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh\nindex 935d101..88c6b5b 100755\n--- a/t/t4015-diff-whitespace.sh\n+++ b/t/t4015-diff-whitespace.sh\n@@ -330,7 +330,7 @@ test_expect_success 'check space before tab in indent (space-before-tab: on)' '\n \n test_expect_success 'check spaces as indentation (indent-with-non-tab: off)' '\n \n-\tgit config core.whitespace \"-indent-with-non-tab\"\n+\tgit config core.whitespace \"-indent-with-non-tab\" &&\n \techo \"        foo ();\" > x &&\n \tgit diff --check\n \ndiff --git a/t/t4021-format-patch-numbered.sh b/t/t4021-format-patch-numbered.sh\nindex 709b323..886494b 100755\n--- a/t/t4021-format-patch-numbered.sh\n+++ b/t/t4021-format-patch-numbered.sh\n@@ -95,7 +95,7 @@ test_expect_success 'format.numbered && --keep-subject' '\n \n test_expect_success 'format.numbered = auto' '\n \n-\tgit config format.numbered auto\n+\tgit config format.numbered auto &&\n \tgit format-patch --stdout HEAD~2 > patch5 &&\n \ttest_numbered patch5\n \ndiff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh\nindex d99814a..241a74d 100755\n--- a/t/t4027-diff-submodule.sh\n+++ b/t/t4027-diff-submodule.sh\n@@ -316,11 +316,11 @@ test_expect_success 'git diff (empty submodule dir)' '\n test_expect_success 'conflicted submodule setup' '\n \n \t# 39 efs\n-\tc=fffffffffffffffffffffffffffffffffffffff\n+\tc=fffffffffffffffffffffffffffffffffffffff &&\n \t(\n-\t\techo \"000000 $_z40 0\tsub\"\n-\t\techo \"160000 1$c 1\tsub\"\n-\t\techo \"160000 2$c 2\tsub\"\n+\t\techo \"000000 $_z40 0\tsub\" &&\n+\t\techo \"160000 1$c 1\tsub\" &&\n+\t\techo \"160000 2$c 2\tsub\" &&\n \t\techo \"160000 3$c 3\tsub\"\n \t) | git update-index --index-info &&\n \techo >expect.nosub '\\''diff --cc sub\ndiff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh\nindex 6f7548c..483f6a0 100755\n--- a/t/t4034-diff-words.sh\n+++ b/t/t4034-diff-words.sh\n@@ -6,8 +6,8 @@ test_description='word diff colors'\n \n test_expect_success setup '\n \n-\tgit config diff.color.old red\n-\tgit config diff.color.new green\n+\tgit config diff.color.old red &&\n+\tgit config diff.color.new green &&\n \tgit config diff.color.func magenta\n \n '\ndiff --git a/t/t4103-apply-binary.sh b/t/t4103-apply-binary.sh\nindex 9692f16..954118c 100755\n--- a/t/t4103-apply-binary.sh\n+++ b/t/t4103-apply-binary.sh\n@@ -41,11 +41,11 @@ test_expect_success 'setup' \"\n \"\n \n test_expect_success 'stat binary diff -- should not fail.' \\\n-\t'git checkout master\n+\t'git checkout master &&\n \t git apply --stat --summary B.diff'\n \n test_expect_success 'stat binary diff (copy) -- should not fail.' \\\n-\t'git checkout master\n+\t'git checkout master &&\n \t git apply --stat --summary C.diff'\n \n test_expect_success 'check binary diff -- should fail.' \\\n@@ -69,11 +69,11 @@ test_expect_success \\\n '\n \n test_expect_success 'check binary diff with replacement.' \\\n-\t'git checkout master\n+\t'git checkout master &&\n \t git apply --check --allow-binary-replacement BF.diff'\n \n test_expect_success 'check binary diff with replacement (copy).' \\\n-\t'git checkout master\n+\t'git checkout master &&\n \t git apply --check --allow-binary-replacement CF.diff'\n \n # Now we start applying them.\ndiff --git a/t/t4111-apply-subdir.sh b/t/t4111-apply-subdir.sh\nindex a52d94a..7c39843 100755\n--- a/t/t4111-apply-subdir.sh\n+++ b/t/t4111-apply-subdir.sh\n@@ -89,7 +89,7 @@ test_expect_success 'apply --index from subdir of toplevel' '\n test_expect_success 'apply from .git dir' '\n \tcp postimage expected &&\n \tcp preimage .git/file &&\n-\tcp preimage .git/objects/file\n+\tcp preimage .git/objects/file &&\n \t(\n \t\tcd .git &&\n \t\tgit apply \"$patch\"\n@@ -100,7 +100,7 @@ test_expect_success 'apply from .git dir' '\n test_expect_success 'apply from subdir of .git dir' '\n \tcp postimage expected &&\n \tcp preimage .git/file &&\n-\tcp preimage .git/objects/file\n+\tcp preimage .git/objects/file &&\n \t(\n \t\tcd .git/objects &&\n \t\tgit apply \"$patch\"\ndiff --git a/t/t4119-apply-config.sh b/t/t4119-apply-config.sh\nindex 3c73a78..3d0384d 100755\n--- a/t/t4119-apply-config.sh\n+++ b/t/t4119-apply-config.sh\n@@ -73,7 +73,7 @@ D=`pwd`\n test_expect_success 'apply --whitespace=strip in subdir' '\n \n \tcd \"$D\" &&\n-\tgit config --unset-all apply.whitespace\n+\tgit config --unset-all apply.whitespace &&\n \trm -f sub/file1 &&\n \tcp saved sub/file1 &&\n \tgit update-index --refresh &&\ndiff --git a/t/t4127-apply-same-fn.sh b/t/t4127-apply-same-fn.sh\nindex 77200c0..972946c 100755\n--- a/t/t4127-apply-same-fn.sh\n+++ b/t/t4127-apply-same-fn.sh\n@@ -31,7 +31,7 @@ test_expect_success 'apply same filename with independent changes' '\n '\n \n test_expect_success 'apply same filename with overlapping changes' '\n-\tgit reset --hard\n+\tgit reset --hard &&\n \tmodify \"s/^d/z/\" same_fn &&\n \tgit diff > patch0 &&\n \tgit add same_fn &&\n@@ -44,8 +44,8 @@ test_expect_success 'apply same filename with overlapping changes' '\n '\n \n test_expect_success 'apply same new filename after rename' '\n-\tgit reset --hard\n-\tgit mv same_fn new_fn\n+\tgit reset --hard &&\n+\tgit mv same_fn new_fn &&\n \tmodify \"s/^d/z/\" new_fn &&\n \tgit add new_fn &&\n \tgit diff -M --cached > patch1 &&\n@@ -58,12 +58,12 @@ test_expect_success 'apply same new filename after rename' '\n '\n \n test_expect_success 'apply same old filename after rename -- should fail.' '\n-\tgit reset --hard\n-\tgit mv same_fn new_fn\n+\tgit reset --hard &&\n+\tgit mv same_fn new_fn &&\n \tmodify \"s/^d/z/\" new_fn &&\n \tgit add new_fn &&\n \tgit diff -M --cached > patch1 &&\n-\tgit mv new_fn same_fn\n+\tgit mv new_fn same_fn &&\n \tmodify \"s/^e/y/\" same_fn &&\n \tgit diff >> patch1 &&\n \tgit reset --hard &&\n@@ -71,13 +71,13 @@ test_expect_success 'apply same old filename after rename -- should fail.' '\n '\n \n test_expect_success 'apply A->B (rename), C->A (rename), A->A -- should pass.' '\n-\tgit reset --hard\n-\tgit mv same_fn new_fn\n+\tgit reset --hard &&\n+\tgit mv same_fn new_fn &&\n \tmodify \"s/^d/z/\" new_fn &&\n \tgit add new_fn &&\n \tgit diff -M --cached > patch1 &&\n \tgit commit -m \"a rename\" &&\n-\tgit mv other_fn same_fn\n+\tgit mv other_fn same_fn &&\n \tmodify \"s/^e/y/\" same_fn &&\n \tgit add same_fn &&\n \tgit diff -M --cached >> patch1 &&\ndiff --git a/t/t4130-apply-criss-cross-rename.sh b/t/t4130-apply-criss-cross-rename.sh\nindex 7cfa2d6..d173acd 100755\n--- a/t/t4130-apply-criss-cross-rename.sh\n+++ b/t/t4130-apply-criss-cross-rename.sh\n@@ -44,7 +44,7 @@ test_expect_success 'criss-cross rename' '\n \tgit reset --hard &&\n \tmv file1 tmp &&\n \tmv file2 file1 &&\n-\tmv file3 file2\n+\tmv file3 file2 &&\n \tmv tmp file3 &&\n \tcp file1 file1-swapped &&\n \tcp file2 file2-swapped &&\ndiff --git a/t/t4133-apply-filenames.sh b/t/t4133-apply-filenames.sh\nindex 3421807..94da990 100755\n--- a/t/t4133-apply-filenames.sh\n+++ b/t/t4133-apply-filenames.sh\n@@ -8,7 +8,7 @@ test_description='git apply filename consistency check'\n . ./test-lib.sh\n \n test_expect_success setup '\n-\tcat > bad1.patch <<EOF\n+\tcat > bad1.patch <<EOF &&\n diff --git a/f b/f\n new file mode 100644\n index 0000000..d00491f\n@@ -29,9 +29,9 @@ EOF\n '\n \n test_expect_success 'apply diff with inconsistent filenames in headers' '\n-\ttest_must_fail git apply bad1.patch 2>err\n-\tgrep \"inconsistent new filename\" err\n-\ttest_must_fail git apply bad2.patch 2>err\n+\ttest_must_fail git apply bad1.patch 2>err &&\n+\tgrep \"inconsistent new filename\" err &&\n+\ttest_must_fail git apply bad2.patch 2>err &&\n \tgrep \"inconsistent old filename\" err\n '\n \ndiff --git a/t/t4134-apply-submodule.sh b/t/t4134-apply-submodule.sh\nindex 1b82f93..0043930 100755\n--- a/t/t4134-apply-submodule.sh\n+++ b/t/t4134-apply-submodule.sh\n@@ -8,7 +8,7 @@ test_description='git apply submodule tests'\n . ./test-lib.sh\n \n test_expect_success setup '\n-\tcat > create-sm.patch <<EOF\n+\tcat > create-sm.patch <<EOF &&\n diff --git a/dir/sm b/dir/sm\n new file mode 160000\n index 0000000..0123456\ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex 1c3d8ed..850fc96 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -219,7 +219,7 @@ test_expect_success 'am stays in branch' '\n \n test_expect_success 'am --signoff does not add Signed-off-by: line if already there' '\n \tgit format-patch --stdout HEAD^ >patch3 &&\n-\tsed -e \"/^Subject/ s,\\[PATCH,Re: Re: Re: & 1/5 v2,\" patch3 >patch4\n+\tsed -e \"/^Subject/ s,\\[PATCH,Re: Re: Re: & 1/5 v2,\" patch3 >patch4 &&\n \trm -fr .git/rebase-apply &&\n \tgit reset --hard &&\n \tgit checkout HEAD^ &&\ndiff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh\nindex cdb70b4..6872ba1 100755\n--- a/t/t4201-shortlog.sh\n+++ b/t/t4201-shortlog.sh\n@@ -35,7 +35,7 @@ test_expect_success 'setup' '\n \t\ttr 1234 \"\\370\\235\\204\\236\")\" a1 &&\n \n \techo 5 >a1 &&\n-\tgit commit --quiet -m \"a\t\t\t\t\t\t\t\t12\t34\t56\t78\" a1\n+\tgit commit --quiet -m \"a\t\t\t\t\t\t\t\t12\t34\t56\t78\" a1 &&\n \n \techo 6 >a1 &&\n \tgit commit --quiet -m \"Commit by someone else\" \\\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex 1172e45..a8c33d5 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -191,7 +191,7 @@ test_expect_success 'git show <commits> leaves list of commits as given' '\n test_expect_success 'setup case sensitivity tests' '\n \techo case >one &&\n \ttest_tick &&\n-\tgit add one\n+\tgit add one &&\n \tgit commit -a -m Second\n '\n \n@@ -341,7 +341,7 @@ test_expect_success 'set up more tangled history' '\n \ttest_commit octopus-b &&\n \tgit checkout master &&\n \ttest_commit seventh &&\n-\tgit merge octopus-a octopus-b\n+\tgit merge octopus-a octopus-b &&\n \tgit merge reach\n '\n \ndiff --git a/t/t4252-am-options.sh b/t/t4252-am-options.sh\nindex f603c1b..e758e63 100755\n--- a/t/t4252-am-options.sh\n+++ b/t/t4252-am-options.sh\n@@ -59,7 +59,7 @@ test_expect_success 'interrupted am --directory=\"frotz nitfol\"' '\n '\n \n test_expect_success 'apply to a funny path' '\n-\twith_sq=\"with'\\''sq\"\n+\twith_sq=\"with'\\''sq\" &&\n \trm -fr .git/rebase-apply &&\n \tgit reset --hard initial &&\n \tgit am --directory=\"$with_sq\" \"$tm\"/am-test-5-2 &&\ndiff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh\nindex bbb9c12..602806d 100755\n--- a/t/t5300-pack-object.sh\n+++ b/t/t5300-pack-object.sh\n@@ -12,7 +12,7 @@ TRASH=`pwd`\n \n test_expect_success \\\n     'setup' \\\n-    'rm -f .git/index*\n+    'rm -f .git/index* &&\n      perl -e \"print \\\"a\\\" x 4096;\" > a &&\n      perl -e \"print \\\"b\\\" x 4096;\" > b &&\n      perl -e \"print \\\"c\\\" x 4096;\" > c &&\ndiff --git a/t/t5301-sliding-window.sh b/t/t5301-sliding-window.sh\nindex 0a24e61..2fc5af6 100755\n--- a/t/t5301-sliding-window.sh\n+++ b/t/t5301-sliding-window.sh\n@@ -8,7 +8,7 @@ test_description='mmap sliding window tests'\n \n test_expect_success \\\n     'setup' \\\n-    'rm -f .git/index*\n+    'rm -f .git/index* &&\n      for i in a b c\n      do\n          echo $i >$i &&\n@@ -48,7 +48,7 @@ test_expect_success \\\n      git repack -a -d &&\n      test \"`git count-objects`\" = \"0 objects, 0 kilobytes\" &&\n      pack2=`ls .git/objects/pack/*.pack` &&\n-     test -f \"$pack2\"\n+     test -f \"$pack2\" &&\n      test \"$pack1\" \\!= \"$pack2\"'\n \n test_expect_success \\\ndiff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh\nindex fb3a270..b34ea93 100755\n--- a/t/t5302-pack-index.sh\n+++ b/t/t5302-pack-index.sh\n@@ -8,7 +8,7 @@ test_description='pack index with 64-bit offsets and object CRC'\n \n test_expect_success \\\n     'setup' \\\n-    'rm -rf .git\n+    'rm -rf .git &&\n      git init &&\n      git config pack.threads 1 &&\n      i=1 &&\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 18376d6..bafcca7 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -91,7 +91,7 @@ test_expect_success 'setup' '\n \t\tprev=$cur &&\n \t\tcur=$(($cur+1))\n \tdone &&\n-\tadd B1 $A1\n+\tadd B1 $A1 &&\n \techo $ATIP > .git/refs/heads/A &&\n \techo $BTIP > .git/refs/heads/B &&\n \tgit symbolic-ref HEAD refs/heads/B\ndiff --git a/t/t5502-quickfetch.sh b/t/t5502-quickfetch.sh\nindex 1037a72..7a46cbd 100755\n--- a/t/t5502-quickfetch.sh\n+++ b/t/t5502-quickfetch.sh\n@@ -57,7 +57,7 @@ test_expect_success 'copy commit and tree but not blob by hand' '\n \t\tcd cloned &&\n \t\tgit count-objects | sed -e \"s/ *objects,.*//\"\n \t) ) &&\n-\ttest $cnt -eq 6\n+\ttest $cnt -eq 6 &&\n \n \tblob=$(git rev-parse HEAD:file | sed -e \"s|..|&/|\") &&\n \ttest -f \"cloned/.git/objects/$blob\" &&\ndiff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh\nindex 9a88475..7e433b1 100755\n--- a/t/t5510-fetch.sh\n+++ b/t/t5510-fetch.sh\n@@ -119,7 +119,7 @@ test_expect_success 'fetch must not resolve short tag name' '\n test_expect_success 'fetch must not resolve short remote name' '\n \n \tcd \"$D\" &&\n-\tgit update-ref refs/remotes/six/HEAD HEAD\n+\tgit update-ref refs/remotes/six/HEAD HEAD &&\n \n \tmkdir six &&\n \tcd six &&\ndiff --git a/t/t5514-fetch-multiple.sh b/t/t5514-fetch-multiple.sh\nindex b737332..227dd56 100755\n--- a/t/t5514-fetch-multiple.sh\n+++ b/t/t5514-fetch-multiple.sh\n@@ -27,7 +27,7 @@ test_expect_success setup '\n \t(\n \t\tcd two && git branch another\n \t) &&\n-\tgit clone --mirror two three\n+\tgit clone --mirror two three &&\n \tgit clone one test\n '\n \ndiff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh\nindex b11da79..d73731e 100755\n--- a/t/t5516-fetch-push.sh\n+++ b/t/t5516-fetch-push.sh\n@@ -586,7 +586,7 @@ test_expect_success 'push --delete refuses src:dest refspecs' '\n '\n \n test_expect_success 'warn on push to HEAD of non-bare repository' '\n-\tmk_test heads/master\n+\tmk_test heads/master &&\n \t(\n \t\tcd testrepo &&\n \t\tgit checkout master &&\n@@ -597,7 +597,7 @@ test_expect_success 'warn on push to HEAD of non-bare repository' '\n '\n \n test_expect_success 'deny push to HEAD of non-bare repository' '\n-\tmk_test heads/master\n+\tmk_test heads/master &&\n \t(\n \t\tcd testrepo &&\n \t\tgit checkout master &&\n@@ -607,7 +607,7 @@ test_expect_success 'deny push to HEAD of non-bare repository' '\n '\n \n test_expect_success 'allow push to HEAD of bare repository (bare)' '\n-\tmk_test heads/master\n+\tmk_test heads/master &&\n \t(\n \t\tcd testrepo &&\n \t\tgit checkout master &&\n@@ -619,7 +619,7 @@ test_expect_success 'allow push to HEAD of bare repository (bare)' '\n '\n \n test_expect_success 'allow push to HEAD of non-bare repository (config)' '\n-\tmk_test heads/master\n+\tmk_test heads/master &&\n \t(\n \t\tcd testrepo &&\n \t\tgit checkout master &&\ndiff --git a/t/t5519-push-alternates.sh b/t/t5519-push-alternates.sh\nindex 96be523..c00c9b0 100755\n--- a/t/t5519-push-alternates.sh\n+++ b/t/t5519-push-alternates.sh\n@@ -123,7 +123,7 @@ test_expect_success 'bob works and pushes again' '\n \t(\n \t\tcd alice-pub &&\n \t\tgit cat-file commit master >../bob-work/commit\n-\t)\n+\t) &&\n \t(\n \t\t# This time Bob does not pull from Alice, and\n \t\t# the master branch at her public repository points\ndiff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh\nindex 65d8d47..faa2e96 100755\n--- a/t/t5531-deep-submodule-push.sh\n+++ b/t/t5531-deep-submodule-push.sh\n@@ -6,7 +6,7 @@ test_description='unpack-objects'\n \n test_expect_success setup '\n \tmkdir pub.git &&\n-\tGIT_DIR=pub.git git init --bare\n+\tGIT_DIR=pub.git git init --bare &&\n \tGIT_DIR=pub.git git config receive.fsckobjects true &&\n \tmkdir work &&\n \t(\ndiff --git a/t/t556x_common b/t/t556x_common\nindex be024e5..03dcfb1 100755\n--- a/t/t556x_common\n+++ b/t/t556x_common\n@@ -52,21 +52,21 @@ get_static_files() {\n SMART=smart\n export GIT_HTTP_EXPORT_ALL=1\n test_expect_success 'direct refs/heads/master not found' '\n-\tlog_div \"refs/heads/master\"\n+\tlog_div \"refs/heads/master\" &&\n \tGET refs/heads/master \"404 Not Found\"\n '\n test_expect_success 'static file is ok' '\n-\tlog_div \"getanyfile default\"\n+\tlog_div \"getanyfile default\" &&\n \tget_static_files \"200 OK\"\n '\n SMART=smart_noexport\n unset GIT_HTTP_EXPORT_ALL\n test_expect_success 'no export by default' '\n-\tlog_div \"no git-daemon-export-ok\"\n+\tlog_div \"no git-daemon-export-ok\" &&\n \tget_static_files \"404 Not Found\"\n '\n test_expect_success 'export if git-daemon-export-ok' '\n-\tlog_div \"git-daemon-export-ok\"\n+\tlog_div \"git-daemon-export-ok\" &&\n         (cd \"$HTTPD_DOCUMENT_ROOT_PATH/repo.git\" &&\n \t touch git-daemon-export-ok\n \t) &&\n@@ -75,47 +75,47 @@ test_expect_success 'export if git-daemon-export-ok' '\n SMART=smart\n export GIT_HTTP_EXPORT_ALL=1\n test_expect_success 'static file if http.getanyfile true is ok' '\n-\tlog_div \"getanyfile true\"\n+\tlog_div \"getanyfile true\" &&\n \tconfig http.getanyfile true &&\n \tget_static_files \"200 OK\"\n '\n test_expect_success 'static file if http.getanyfile false fails' '\n-\tlog_div \"getanyfile false\"\n+\tlog_div \"getanyfile false\" &&\n \tconfig http.getanyfile false &&\n \tget_static_files \"403 Forbidden\"\n '\n \n test_expect_success 'http.uploadpack default enabled' '\n-\tlog_div \"uploadpack default\"\n+\tlog_div \"uploadpack default\" &&\n \tGET info/refs?service=git-upload-pack \"200 OK\"  &&\n \tPOST git-upload-pack 0000 \"200 OK\"\n '\n test_expect_success 'http.uploadpack true' '\n-\tlog_div \"uploadpack true\"\n+\tlog_div \"uploadpack true\" &&\n \tconfig http.uploadpack true &&\n \tGET info/refs?service=git-upload-pack \"200 OK\" &&\n \tPOST git-upload-pack 0000 \"200 OK\"\n '\n test_expect_success 'http.uploadpack false' '\n-\tlog_div \"uploadpack false\"\n+\tlog_div \"uploadpack false\" &&\n \tconfig http.uploadpack false &&\n \tGET info/refs?service=git-upload-pack \"403 Forbidden\" &&\n \tPOST git-upload-pack 0000 \"403 Forbidden\"\n '\n \n test_expect_success 'http.receivepack default disabled' '\n-\tlog_div \"receivepack default\"\n+\tlog_div \"receivepack default\" &&\n \tGET info/refs?service=git-receive-pack \"403 Forbidden\"  &&\n \tPOST git-receive-pack 0000 \"403 Forbidden\"\n '\n test_expect_success 'http.receivepack true' '\n-\tlog_div \"receivepack true\"\n+\tlog_div \"receivepack true\" &&\n \tconfig http.receivepack true &&\n \tGET info/refs?service=git-receive-pack \"200 OK\" &&\n \tPOST git-receive-pack 0000 \"200 OK\"\n '\n test_expect_success 'http.receivepack false' '\n-\tlog_div \"receivepack false\"\n+\tlog_div \"receivepack false\" &&\n \tconfig http.receivepack false &&\n \tGET info/refs?service=git-receive-pack \"403 Forbidden\" &&\n \tPOST git-receive-pack 0000 \"403 Forbidden\"\ndiff --git a/t/t6001-rev-list-graft.sh b/t/t6001-rev-list-graft.sh\nindex fc57e7d..8efcd13 100755\n--- a/t/t6001-rev-list-graft.sh\n+++ b/t/t6001-rev-list-graft.sh\n@@ -90,22 +90,22 @@ check () {\n for type in basic parents parents-raw\n do\n \ttest_expect_success 'without grafts' \"\n-\t\trm -f .git/info/grafts\n+\t\trm -f .git/info/grafts &&\n \t\tcheck $type $B2 -- $B2 $B1 $B0\n \t\"\n \n \ttest_expect_success 'with grafts' \"\n-\t\techo '$B0 $A2' >.git/info/grafts\n+\t\techo '$B0 $A2' >.git/info/grafts &&\n \t\tcheck $type $B2 -- $B2 $B1 $B0 $A2 $A1 $A0\n \t\"\n \n \ttest_expect_success 'without grafts, with pathlimit' \"\n-\t\trm -f .git/info/grafts\n+\t\trm -f .git/info/grafts &&\n \t\tcheck $type $B2 subdir -- $B2 $B0\n \t\"\n \n \ttest_expect_success 'with grafts, with pathlimit' \"\n-\t\techo '$B0 $A2' >.git/info/grafts\n+\t\techo '$B0 $A2' >.git/info/grafts &&\n \t\tcheck $type $B2 subdir -- $B2 $B0 $A2 $A0\n \t\"\n \ndiff --git a/t/t6009-rev-list-parent.sh b/t/t6009-rev-list-parent.sh\nindex c8a96a9..52f7b27 100755\n--- a/t/t6009-rev-list-parent.sh\n+++ b/t/t6009-rev-list-parent.sh\n@@ -18,7 +18,7 @@ test_expect_success setup '\n \n \tcommit one &&\n \n-\ttest_tick=$(($test_tick - 2400))\n+\ttest_tick=$(($test_tick - 2400)) &&\n \n \tcommit two &&\n \tcommit three &&\ndiff --git a/t/t6010-merge-base.sh b/t/t6010-merge-base.sh\nindex 62197a3..082032e 100755\n--- a/t/t6010-merge-base.sh\n+++ b/t/t6010-merge-base.sh\n@@ -131,7 +131,7 @@ test_expect_success 'unsynchronized clocks' '\n \tR2=$(doit  3 R2 $R1) &&\n \n \tPL=$(doit  4 PL $L2 $C2) &&\n-\tPR=$(doit  4 PR $C2 $R2)\n+\tPR=$(doit  4 PR $C2 $R2) &&\n \n \tgit name-rev $C2 >expected &&\n \ndiff --git a/t/t6024-recursive-merge.sh b/t/t6024-recursive-merge.sh\nindex b3fbf65..755d30c 100755\n--- a/t/t6024-recursive-merge.sh\n+++ b/t/t6024-recursive-merge.sh\n@@ -104,7 +104,7 @@ test_expect_success 'mark rename/delete as unmerged' '\n \ttest_tick &&\n \tgit commit -m delete &&\n \tgit checkout -b rename HEAD^ &&\n-\tgit mv a1 a2\n+\tgit mv a1 a2 &&\n \ttest_tick &&\n \tgit commit -m rename &&\n \ttest_must_fail git merge delete &&\ndiff --git a/t/t6029-merge-subtree.sh b/t/t6029-merge-subtree.sh\nindex 3900d9f..73fc240 100755\n--- a/t/t6029-merge-subtree.sh\n+++ b/t/t6029-merge-subtree.sh\n@@ -6,7 +6,7 @@ test_description='subtree merge strategy'\n \n test_expect_success setup '\n \n-\ts=\"1 2 3 4 5 6 7 8\"\n+\ts=\"1 2 3 4 5 6 7 8\" &&\n \tfor i in $s; do echo $i; done >hello &&\n \tgit add hello &&\n \tgit commit -m initial &&\ndiff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh\nindex 3b042aa..b5063b6 100755\n--- a/t/t6030-bisect-porcelain.sh\n+++ b/t/t6030-bisect-porcelain.sh\n@@ -517,13 +517,13 @@ test_expect_success '\"parallel\" side branch creation' '\n \tadd_line_into_file \"2(para): line 2 on parallel branch\" dir2/file2 &&\n \tPARA_HASH2=$(git rev-parse --verify HEAD) &&\n \tadd_line_into_file \"3(para): line 3 on parallel branch\" dir2/file3 &&\n-\tPARA_HASH3=$(git rev-parse --verify HEAD)\n+\tPARA_HASH3=$(git rev-parse --verify HEAD) &&\n \tgit merge -m \"merge HASH4 and PARA_HASH3\" \"$HASH4\" &&\n-\tPARA_HASH4=$(git rev-parse --verify HEAD)\n+\tPARA_HASH4=$(git rev-parse --verify HEAD) &&\n \tadd_line_into_file \"5(para): add line on parallel branch\" dir1/file1 &&\n-\tPARA_HASH5=$(git rev-parse --verify HEAD)\n+\tPARA_HASH5=$(git rev-parse --verify HEAD) &&\n \tadd_line_into_file \"6(para): add line on parallel branch\" dir2/file2 &&\n-\tPARA_HASH6=$(git rev-parse --verify HEAD)\n+\tPARA_HASH6=$(git rev-parse --verify HEAD) &&\n \tgit merge -m \"merge HASH7 and PARA_HASH6\" \"$HASH7\" &&\n \tPARA_HASH7=$(git rev-parse --verify HEAD)\n '\ndiff --git a/t/t6036-recursive-corner-cases.sh b/t/t6036-recursive-corner-cases.sh\nindex b874141..004c365 100755\n--- a/t/t6036-recursive-corner-cases.sh\n+++ b/t/t6036-recursive-corner-cases.sh\n@@ -15,7 +15,7 @@ test_description='recursive merge corner cases'\n #\n \n test_expect_success setup '\n-\tten=\"0 1 2 3 4 5 6 7 8 9\"\n+\tten=\"0 1 2 3 4 5 6 7 8 9\" &&\n \tfor i in $ten\n \tdo\n \t\techo line $i in a sample file\ndiff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh\nindex 1785e17..1e0447f 100755\n--- a/t/t6040-tracking-info.sh\n+++ b/t/t6040-tracking-info.sh\n@@ -60,7 +60,7 @@ test_expect_success 'checkout' '\n \n test_expect_success 'checkout with local tracked branch' '\n \tgit checkout master &&\n-\tgit checkout follower >actual\n+\tgit checkout follower >actual &&\n \tgrep \"is ahead of\" actual\n '\n \ndiff --git a/t/t6050-replace.sh b/t/t6050-replace.sh\nindex 95b180f..ae2194e 100755\n--- a/t/t6050-replace.sh\n+++ b/t/t6050-replace.sh\n@@ -53,7 +53,7 @@ test_expect_success 'set up buggy branch' '\n      echo \"line 12\" >> hello &&\n      echo \"line 13\" >> hello &&\n      add_and_commit_file hello \"2 more lines\" &&\n-     HASH6=$(git rev-parse --verify HEAD)\n+     HASH6=$(git rev-parse --verify HEAD) &&\n      echo \"line 14\" >> hello &&\n      echo \"line 15\" >> hello &&\n      echo \"line 16\" >> hello &&\ndiff --git a/t/t7105-reset-patch.sh b/t/t7105-reset-patch.sh\nindex 9891e2c..95fab20 100755\n--- a/t/t7105-reset-patch.sh\n+++ b/t/t7105-reset-patch.sh\n@@ -18,7 +18,7 @@ test_expect_success PERL 'setup' '\n # note: bar sorts before foo, so the first 'n' is always to skip 'bar'\n \n test_expect_success PERL 'saying \"n\" does nothing' '\n-\tset_and_save_state dir/foo work work\n+\tset_and_save_state dir/foo work work &&\n \t(echo n; echo n) | git reset -p &&\n \tverify_saved_state dir/foo &&\n \tverify_saved_state bar\n@@ -42,14 +42,14 @@ test_expect_success PERL 'git reset -p HEAD^' '\n # the failure case (and thus get out of the loop).\n \n test_expect_success PERL 'git reset -p dir' '\n-\tset_state dir/foo work work\n+\tset_state dir/foo work work &&\n \t(echo y; echo n) | git reset -p dir &&\n \tverify_state dir/foo work head &&\n \tverify_saved_state bar\n '\n \n test_expect_success PERL 'git reset -p -- foo (inside dir)' '\n-\tset_state dir/foo work work\n+\tset_state dir/foo work work &&\n \t(echo y; echo n) | (cd dir && git reset -p -- foo) &&\n \tverify_state dir/foo work head &&\n \tverify_saved_state bar\ndiff --git a/t/t7509-commit.sh b/t/t7509-commit.sh\nindex 643ab03..77b6920 100755\n--- a/t/t7509-commit.sh\n+++ b/t/t7509-commit.sh\n@@ -40,7 +40,7 @@ test_expect_success '-C option copies only the message with --reset-author' '\n \ttest_tick &&\n \tgit commit -a -C Initial --reset-author &&\n \techo \"author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> $GIT_AUTHOR_DATE\" >expect &&\n-\tauthor_header HEAD >actual\n+\tauthor_header HEAD >actual &&\n \ttest_cmp expect actual &&\n \n \tmessage_body Initial >expect &&\ndiff --git a/t/t7602-merge-octopus-many.sh b/t/t7602-merge-octopus-many.sh\nindex 2746169..0a46795 100755\n--- a/t/t7602-merge-octopus-many.sh\n+++ b/t/t7602-merge-octopus-many.sh\n@@ -31,7 +31,7 @@ test_expect_success 'merge c1 with c2, c3, c4, ... c29' '\n \tdo\n \t\trefs=\"$refs c$i\"\n \t\ti=`expr $i + 1`\n-\tdone\n+\tdone &&\n \tgit merge $refs &&\n \ttest \"$(git rev-parse c1)\" != \"$(git rev-parse HEAD)\" &&\n \ti=1 &&\ndiff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh\nindex 3bd7404..d78bdec 100755\n--- a/t/t7610-mergetool.sh\n+++ b/t/t7610-mergetool.sh\n@@ -54,7 +54,7 @@ test_expect_success 'custom mergetool' '\n \n test_expect_success 'mergetool crlf' '\n     git config core.autocrlf true &&\n-    git checkout -b test2 branch1\n+    git checkout -b test2 branch1 &&\n     test_must_fail git merge master >/dev/null 2>&1 &&\n     ( yes \"\" | git mergetool file1 >/dev/null 2>&1 ) &&\n     ( yes \"\" | git mergetool file2 >/dev/null 2>&1 ) &&\ndiff --git a/t/t7810-grep.sh b/t/t7810-grep.sh\nindex 023f225..79195e2 100755\n--- a/t/t7810-grep.sh\n+++ b/t/t7810-grep.sh\n@@ -452,7 +452,7 @@ test_expect_success 'outside of git repository' '\n \t\techo file1:hello &&\n \t\techo sub/file2:world\n \t} >non/expect.full &&\n-\techo file2:world >non/expect.sub\n+\techo file2:world >non/expect.sub &&\n \t(\n \t\tGIT_CEILING_DIRECTORIES=\"$(pwd)/non/git\" &&\n \t\texport GIT_CEILING_DIRECTORIES &&\n@@ -478,7 +478,7 @@ test_expect_success 'inside git repository but with --no-index' '\n \t\techo sub/file2:world\n \t} >is/expect.full &&\n \t: >is/expect.empty &&\n-\techo file2:world >is/expect.sub\n+\techo file2:world >is/expect.sub &&\n \t(\n \t\tcd is/git &&\n \t\tgit init &&\ndiff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh\nindex f7f3c5a..13b179e 100755\n--- a/t/t9104-git-svn-follow-parent.sh\n+++ b/t/t9104-git-svn-follow-parent.sh\n@@ -190,7 +190,7 @@ test_expect_success \"follow-parent is atomic\" '\n \tgit svn init --minimize-url -i stunk \"$svnrepo\"/stunk &&\n \tgit svn fetch -i stunk &&\n \tgit svn init --minimize-url -i flunked \"$svnrepo\"/flunked &&\n-\tgit svn fetch -i flunked\n+\tgit svn fetch -i flunked &&\n \ttest \"`git rev-parse --verify refs/remotes/flunk@18`\" \\\n \t   = \"`git rev-parse --verify refs/remotes/stunk`\" &&\n \ttest \"`git rev-parse --verify refs/remotes/flunk~1`\" \\\ndiff --git a/t/t9123-git-svn-rebuild-with-rewriteroot.sh b/t/t9123-git-svn-rebuild-with-rewriteroot.sh\nindex 0ed90d9..fd81847 100755\n--- a/t/t9123-git-svn-rebuild-with-rewriteroot.sh\n+++ b/t/t9123-git-svn-rebuild-with-rewriteroot.sh\n@@ -16,7 +16,7 @@ rm -rf import\n \n test_expect_success 'init, fetch and checkout repository' '\n \tgit svn init --rewrite-root=http://invalid.invalid/ \"$svnrepo\" &&\n-\tgit svn fetch\n+\tgit svn fetch &&\n \tgit checkout -b mybranch ${remotes_git_svn}\n \t'\n \ndiff --git a/t/t9124-git-svn-dcommit-auto-props.sh b/t/t9124-git-svn-dcommit-auto-props.sh\nindex d6b076f..aa841e1 100755\n--- a/t/t9124-git-svn-dcommit-auto-props.sh\n+++ b/t/t9124-git-svn-dcommit-auto-props.sh\n@@ -24,7 +24,7 @@ test_expect_success 'initialize git svn' '\n \t\tsvn_cmd import -m \"import for git svn\" . \"$svnrepo\"\n \t) &&\n \trm -rf import &&\n-\tgit svn init \"$svnrepo\"\n+\tgit svn init \"$svnrepo\" &&\n \tgit svn fetch\n '\n \ndiff --git a/t/t9151-svn-mergeinfo.sh b/t/t9151-svn-mergeinfo.sh\nindex 250c651..4f6c06e 100755\n--- a/t/t9151-svn-mergeinfo.sh\n+++ b/t/t9151-svn-mergeinfo.sh\n@@ -18,39 +18,39 @@ test_expect_success 'load svn dump' \"\n \n test_expect_success 'all svn merges became git merge commits' '\n \tunmarked=$(git rev-list --parents --all --grep=Merge |\n-\t\tgrep -v \" .* \" | cut -f1 -d\" \")\n+\t\tgrep -v \" .* \" | cut -f1 -d\" \") &&\n \t[ -z \"$unmarked\" ]\n \t'\n \n test_expect_success 'cherry picks did not become git merge commits' '\n \tbad_cherries=$(git rev-list --parents --all --grep=Cherry |\n-\t\tgrep \" .* \" | cut -f1 -d\" \")\n+\t\tgrep \" .* \" | cut -f1 -d\" \") &&\n \t[ -z \"$bad_cherries\" ]\n \t'\n \n test_expect_success 'svn non-merge merge commits did not become git merge commits' '\n \tbad_non_merges=$(git rev-list --parents --all --grep=non-merge |\n-\t\tgrep \" .* \" | cut -f1 -d\" \")\n+\t\tgrep \" .* \" | cut -f1 -d\" \") &&\n \t[ -z \"$bad_non_merges\" ]\n \t'\n \n test_expect_success 'commit made to merged branch is reachable from the merge' '\n-\tbefore_commit=$(git rev-list --all --grep=\"trunk commit before merging trunk to b2\")\n-\tmerge_commit=$(git rev-list --all --grep=\"Merge trunk to b2\")\n-\tnot_reachable=$(git rev-list -1 $before_commit --not $merge_commit)\n+\tbefore_commit=$(git rev-list --all --grep=\"trunk commit before merging trunk to b2\") &&\n+\tmerge_commit=$(git rev-list --all --grep=\"Merge trunk to b2\") &&\n+\tnot_reachable=$(git rev-list -1 $before_commit --not $merge_commit) &&\n \t[ -z \"$not_reachable\" ]\n \t'\n \n test_expect_success 'merging two branches in one commit is detected correctly' '\n-\tf1_commit=$(git rev-list --all --grep=\"make f1 branch from trunk\")\n-\tf2_commit=$(git rev-list --all --grep=\"make f2 branch from trunk\")\n-\tmerge_commit=$(git rev-list --all --grep=\"Merge f1 and f2 to trunk\")\n-\tnot_reachable=$(git rev-list -1 $f1_commit $f2_commit --not $merge_commit)\n+\tf1_commit=$(git rev-list --all --grep=\"make f1 branch from trunk\") &&\n+\tf2_commit=$(git rev-list --all --grep=\"make f2 branch from trunk\") &&\n+\tmerge_commit=$(git rev-list --all --grep=\"Merge f1 and f2 to trunk\") &&\n+\tnot_reachable=$(git rev-list -1 $f1_commit $f2_commit --not $merge_commit) &&\n \t[ -z \"$not_reachable\" ]\n \t'\n \n test_expect_failure 'everything got merged in the end' '\n-\tunmerged=$(git rev-list --all --not master)\n+\tunmerged=$(git rev-list --all --not master) &&\n \t[ -z \"$unmerged\" ]\n \t'\n \ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex 7c05920..ab48f42 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -321,7 +321,7 @@ test_expect_success \\\n \t'for p in .git/objects/pack/*.pack;do git verify-pack $p||exit;done'\n test_expect_success \\\n \t'C: validate reuse existing blob' \\\n-\t'test $newf = `git rev-parse --verify branch:file2/newf`\n+\t'test $newf = `git rev-parse --verify branch:file2/newf` &&\n \t test $oldf = `git rev-parse --verify branch:file2/oldf`'\n \n cat >expect <<EOF\ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex 8c8e679..f823c05 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -26,7 +26,7 @@ test_expect_success 'setup' '\n \ttest_tick &&\n \tgit tag rein &&\n \tgit checkout -b wer HEAD^ &&\n-\techo lange > file2\n+\techo lange > file2 &&\n \ttest_tick &&\n \tgit commit -m sitzt file2 &&\n \ttest_tick &&\ndiff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\nindex 36c457e..9199550 100755\n--- a/t/t9400-git-cvsserver-server.sh\n+++ b/t/t9400-git-cvsserver-server.sh\n@@ -57,7 +57,7 @@ test_expect_success 'setup' '\n # as argument to co -d\n test_expect_success 'basic checkout' \\\n   'GIT_CONFIG=\"$git_config\" cvs -Q co -d cvswork master &&\n-   test \"$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | head -n 1))\" = \"empty/1.1/\"\n+   test \"$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | head -n 1))\" = \"empty/1.1/\" &&\n    test \"$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | sed -ne \\$p))\" = \"secondrootfile/1.1/\"'\n \n #------------------------\ndiff --git a/t/t9401-git-cvsserver-crlf.sh b/t/t9401-git-cvsserver-crlf.sh\nindex 1bbfd82..ff6d6fb 100755\n--- a/t/t9401-git-cvsserver-crlf.sh\n+++ b/t/t9401-git-cvsserver-crlf.sh\n@@ -70,7 +70,7 @@ test_expect_success 'setup' '\n     mkdir subdir &&\n     echo \"Another text file\" > subdir/file.h &&\n     echo \"Another binary: Q (this time CR)\" | q_to_cr > subdir/withCr.bin &&\n-    echo \"Mixed up NUL, but marked text: Q <- there\" | q_to_nul > mixedUp.c\n+    echo \"Mixed up NUL, but marked text: Q <- there\" | q_to_nul > mixedUp.c &&\n     echo \"Unspecified\" > subdir/unspecified.other &&\n     echo \"/*.bin -crlf\" > .gitattributes &&\n     echo \"/*.c crlf\" >> .gitattributes &&\n-- \n1.7.2.3.557.gab647.dirty\n"},{"id":"154861","messageId":"7vr5f73umz.fsf@alter.siamese.dyndns.org","threadId":"25321","inReplyTo":"20101031014654.GC29456@burratino","subject":"Re: [PATCH en/cascade-tests] tests: add missing &&","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-10-31T03:31:48Z","receivedAt":"2010-10-31T03:31:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> @@ -27,7 +27,7 @@ test_expect_success 'see what we expect' '\n>  \t>junk/\"$auml\" &&\n>  \tcase \"$(cd junk && echo *)\" in\n>  \t\"$aumlcdiar\")\n> -\t\ttest_unicode=test_expect_failure\n> +\t\ttest_unicode=test_expect_failure &&\n>  \t\tunibad=t\n>  \t\t;;\n>  \t*)\t;;\n\nThis seems to prepare for a case where a simple variable assignment fails\nfor whategver reason, which is not too bad, but ...\n\n> @@ -36,7 +36,7 @@ test_expect_success 'see what we expect' '\n>  \t{\n>  \t\tln -s x y 2> /dev/null &&\n>  \t\ttest -h y 2> /dev/null ||\n> -\t\tno_symlinks=1\n> +\t\tno_symlinks=1 &&\n>  \t\trm -f y\n\n... if you allowed such a simple assignment failure, no_symlinks=1 may\nfail, and we end up not running \"rm -f y\" to clean up, which might be\nsomewhat undesirable ;-)\n\nLooked up to but not including t5302 and all looked Ok.\n"},{"id":"154869","messageId":"20101031072640.GA11483@burratino","threadId":"25321","inReplyTo":"7vr5f73umz.fsf@alter.siamese.dyndns.org","subject":"[PATCH/RFC 00/10] Re: [PATCH en/cascade-tests] tests: add missing &&","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-31T07:26:40Z","receivedAt":"2010-10-31T07:26:40Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n> Jonathan Nieder <jrnieder@gmail.com> writes:\n\n>> @@ -36,7 +36,7 @@ test_expect_success 'see what we expect' '\n>>  \t{\n>>  \t\tln -s x y 2> /dev/null &&\n>>  \t\ttest -h y 2> /dev/null ||\n>> -\t\tno_symlinks=1\n>> +\t\tno_symlinks=1 &&\n>>  \t\trm -f y\n>\n> ... if you allowed such a simple assignment failure, no_symlinks=1 may\n> fail, and we end up not running \"rm -f y\" to clean up, which might be\n> somewhat undesirable ;-)\n\nThanks.  Will undo that bit in my local version.\n\nActually I don't see why the \"rm -f y\" is needed in the first place,\nbut that is a question for another day.\n\nHere's another batch of patches in the same &&-adding vein.  I'm only\nsending 10 to the list for now; I can mete the rest out at whatever\nrate is useful to people.\n\nJonathan Nieder (27):\n  tests: more missing &&\n  test-lib: introduce test_line_count to measure files\n  t6022 (renaming merge): chain test commands with &&\n  t1502 (rev-parse --parseopt): test exit code from \"-h\"\n  t1400 (update-ref): use test_must_fail\n  t3301 (notes): use test_expect_code for clarity\n  t3404 (rebase -i): unroll test_commit loops\n  t3404 (rebase -i): move comment to description\n  t3404 (rebase -i): introduce helper to check position of HEAD\n  t4124 (apply --whitespace): use test_might_fail\n  t5701 (clone -l): use test_must_fail\n  ttt03, t6032: use test_might_fail\n  t6032 (merge): give body of rename tests its own function\n  t7001 (mv): introduce test_grep function and use it\n  t7004 (tag): use test_must_fail\n  t9146 (git svn): check exit status from svn in loop\n  t9146 (git svn): use test_path_is_dir/missing helpers\n  t8007 (textconv): use test_must_fail\n  t7502 (commit): use test_must_fail\n  t0005 (signals): hide test-sigchain invocation from &&-chaining\n    checker\n  t0020 (convert): improve error checking in loops\n  t0020 (convert): use diff-index --exit-code\n  t0020 (convert): remove \"Huh?\" noise\n  t0040 (parse-options): use test_expect_code\n  t7300 (clean): use test_cmp instead of test \"$foo\" = bar\n  t1501 (rev-parse): use sane_unset\n  t4022 (diff -B): simplify using test_grep\n\n t/README                      |    9 ++\n t/t0005-signals.sh            |   16 ++-\n t/t0020-crlf.sh               |  247 +++++++++---------------------------\n t/t0040-parse-options.sh      |   12 +-\n t/t1400-update-ref.sh         |   25 ++--\n t/t1501-worktree.sh           |    4 +-\n t/t1502-rev-parse-parseopt.sh |    2 +-\n t/t3301-notes.sh              |    8 +-\n t/t3404-rebase-interactive.sh |   88 ++++++-------\n t/t4022-diff-rewrite.sh       |    9 +-\n t/t4124-apply-ws-rule.sh      |   11 +-\n t/t5503-tagfollow.sh          |   10 +-\n t/t5701-clone-local.sh        |   22 +---\n t/t6022-merge-rename.sh       |  282 +++++++++++++---------------------------\n t/t6032-merge-large-rename.sh |   36 ++++--\n t/t7001-mv.sh                 |    8 +-\n t/t7004-tag.sh                |   36 +++---\n t/t7300-clean.sh              |   25 ++--\n t/t7502-commit.sh             |    4 +-\n t/t7700-repack.sh             |    6 +-\n t/t8007-cat-file-textconv.sh  |    2 +-\n t/t9146-git-svn-empty-dirs.sh |   64 ++++------\n t/test-lib.sh                 |   57 ++++++++\n 23 files changed, 395 insertions(+), 588 deletions(-)\n\n-- \n1.7.2.3.557.gab647.dirty\n"},{"id":"154870","messageId":"20101031073058.GB11483@burratino","threadId":"25321","inReplyTo":"20101031072640.GA11483@burratino","subject":"[PATCH 01/10] tests: add missing &&, batch 2","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-31T07:30:58Z","receivedAt":"2010-10-31T07:30:58Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Same rules as before: this patch only adds \" &&\" to the end of\nsome lines in the test suite.\n\nIntended to be applied on top of or squashed with the last\nbatch if they look okay.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/t0020-crlf.sh               |    2 +-\n t/t1400-update-ref.sh         |   20 ++++++++++----------\n t/t3301-notes.sh              |    6 +++---\n t/t3404-rebase-interactive.sh |    6 +++---\n t/t4124-apply-ws-rule.sh      |    6 +++---\n t/t5503-tagfollow.sh          |    6 +++---\n t/t5701-clone-local.sh        |    6 +++---\n t/t7001-mv.sh                 |    2 +-\n t/t7004-tag.sh                |   30 +++++++++++++++---------------\n t/t7300-clean.sh              |    2 +-\n t/t7502-commit.sh             |    2 +-\n t/t7700-repack.sh             |    6 +++---\n t/t9146-git-svn-empty-dirs.sh |    2 +-\n 13 files changed, 48 insertions(+), 48 deletions(-)\n\ndiff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh\nindex 234a94f..1a8f44c 100755\n--- a/t/t0020-crlf.sh\n+++ b/t/t0020-crlf.sh\n@@ -439,7 +439,7 @@ test_expect_success 'checkout when deleting .gitattributes' '\n \tgit rm .gitattributes &&\n \techo \"contentsQ\" | q_to_cr > .file2 &&\n \tgit add .file2 &&\n-\tgit commit -m third\n+\tgit commit -m third &&\n \n \tgit checkout master~1 &&\n \tgit checkout master &&\ndiff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh\nindex 54ba3df..d17551e 100755\n--- a/t/t1400-update-ref.sh\n+++ b/t/t1400-update-ref.sh\n@@ -185,55 +185,55 @@ gd=\"Thu, 26 May 2005 18:33:00 -0500\"\n ld=\"Thu, 26 May 2005 18:43:00 -0500\"\n test_expect_success \\\n \t'Query \"master@{May 25 2005}\" (before history)' \\\n-\t'rm -f o e\n+\t'rm -f o e &&\n \t git rev-parse --verify \"master@{May 25 2005}\" >o 2>e &&\n \t test '\"$C\"' = $(cat o) &&\n \t test \"warning: Log for '\\'master\\'' only goes back to $ed.\" = \"$(cat e)\"'\n test_expect_success \\\n \t\"Query master@{2005-05-25} (before history)\" \\\n-\t'rm -f o e\n+\t'rm -f o e &&\n \t git rev-parse --verify master@{2005-05-25} >o 2>e &&\n \t test '\"$C\"' = $(cat o) &&\n \t echo test \"warning: Log for '\\'master\\'' only goes back to $ed.\" = \"$(cat e)\"'\n test_expect_success \\\n \t'Query \"master@{May 26 2005 23:31:59}\" (1 second before history)' \\\n-\t'rm -f o e\n+\t'rm -f o e &&\n \t git rev-parse --verify \"master@{May 26 2005 23:31:59}\" >o 2>e &&\n \t test '\"$C\"' = $(cat o) &&\n \t test \"warning: Log for '\\''master'\\'' only goes back to $ed.\" = \"$(cat e)\"'\n test_expect_success \\\n \t'Query \"master@{May 26 2005 23:32:00}\" (exactly history start)' \\\n-\t'rm -f o e\n+\t'rm -f o e &&\n \t git rev-parse --verify \"master@{May 26 2005 23:32:00}\" >o 2>e &&\n \t test '\"$C\"' = $(cat o) &&\n \t test \"\" = \"$(cat e)\"'\n test_expect_success \\\n \t'Query \"master@{May 26 2005 23:32:30}\" (first non-creation change)' \\\n-\t'rm -f o e\n+\t'rm -f o e &&\n \t git rev-parse --verify \"master@{May 26 2005 23:32:30}\" >o 2>e &&\n \t test '\"$A\"' = $(cat o) &&\n \t test \"\" = \"$(cat e)\"'\n test_expect_success \\\n \t'Query \"master@{2005-05-26 23:33:01}\" (middle of history with gap)' \\\n-\t'rm -f o e\n+\t'rm -f o e &&\n \t git rev-parse --verify \"master@{2005-05-26 23:33:01}\" >o 2>e &&\n \t test '\"$B\"' = $(cat o) &&\n \t test \"warning: Log .git/logs/'\"$m has gap after $gd\"'.\" = \"$(cat e)\"'\n test_expect_success \\\n \t'Query \"master@{2005-05-26 23:38:00}\" (middle of history)' \\\n-\t'rm -f o e\n+\t'rm -f o e &&\n \t git rev-parse --verify \"master@{2005-05-26 23:38:00}\" >o 2>e &&\n \t test '\"$Z\"' = $(cat o) &&\n \t test \"\" = \"$(cat e)\"'\n test_expect_success \\\n \t'Query \"master@{2005-05-26 23:43:00}\" (exact end of history)' \\\n-\t'rm -f o e\n+\t'rm -f o e &&\n \t git rev-parse --verify \"master@{2005-05-26 23:43:00}\" >o 2>e &&\n \t test '\"$E\"' = $(cat o) &&\n \t test \"\" = \"$(cat e)\"'\n test_expect_success \\\n \t'Query \"master@{2005-05-28}\" (past end of history)' \\\n-\t'rm -f o e\n+\t'rm -f o e &&\n \t git rev-parse --verify \"master@{2005-05-28}\" >o 2>e &&\n \t test '\"$D\"' = $(cat o) &&\n \t test \"warning: Log .git/logs/'\"$m unexpectedly ended on $ld\"'.\" = \"$(cat e)\"'\n@@ -247,7 +247,7 @@ test_expect_success \\\n      git add F &&\n \t GIT_AUTHOR_DATE=\"2005-05-26 23:30\" \\\n \t GIT_COMMITTER_DATE=\"2005-05-26 23:30\" git commit -m add -a &&\n-\t h_TEST=$(git rev-parse --verify HEAD)\n+\t h_TEST=$(git rev-parse --verify HEAD) &&\n \t echo The other day this did not work. >M &&\n \t echo And then Bob told me how to fix it. >>M &&\n \t echo OTHER >F &&\ndiff --git a/t/t3301-notes.sh b/t/t3301-notes.sh\nindex a2b79a0..6931171 100755\n--- a/t/t3301-notes.sh\n+++ b/t/t3301-notes.sh\n@@ -627,16 +627,16 @@ test_expect_success '--show-notes=ref accumulates' '\n \n test_expect_success 'Allow notes on non-commits (trees, blobs, tags)' '\n \tgit config core.notesRef refs/notes/other &&\n-\techo \"Note on a tree\" > expect\n+\techo \"Note on a tree\" > expect &&\n \tgit notes add -m \"Note on a tree\" HEAD: &&\n \tgit notes show HEAD: > actual &&\n \ttest_cmp expect actual &&\n-\techo \"Note on a blob\" > expect\n+\techo \"Note on a blob\" > expect &&\n \tfilename=$(git ls-tree --name-only HEAD | head -n1) &&\n \tgit notes add -m \"Note on a blob\" HEAD:$filename &&\n \tgit notes show HEAD:$filename > actual &&\n \ttest_cmp expect actual &&\n-\techo \"Note on a tag\" > expect\n+\techo \"Note on a tag\" > expect &&\n \tgit tag -a -m \"This is an annotated tag\" foobar HEAD^ &&\n \tgit notes add -m \"Note on a tag\" foobar &&\n \tgit notes show foobar > actual &&\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 7d20a74..c0e69f6 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -46,7 +46,7 @@ test_expect_success 'setup' '\n \ttest_commit G file1 &&\n \ttest_commit H file5 &&\n \tgit checkout -b branch2 F &&\n-\ttest_commit I file6\n+\ttest_commit I file6 &&\n \tgit checkout -b conflict-branch A &&\n \tfor n in one two three four\n \tdo\n@@ -584,7 +584,7 @@ test_expect_success 'do \"noop\" when there is nothing to cherry-pick' '\n \n \tgit checkout -b branch4 HEAD &&\n \tGIT_EDITOR=: git commit --amend \\\n-\t\t--author=\"Somebody else <somebody@else.com>\" \n+\t\t--author=\"Somebody else <somebody@else.com>\" &&\n \ttest $(git rev-parse branch3) != $(git rev-parse branch4) &&\n \tgit rebase -i branch3 &&\n \ttest $(git rev-parse branch3) = $(git rev-parse branch4)\n@@ -599,7 +599,7 @@ test_expect_success 'submodule rebase setup' '\n \t\tgit add elif && git commit -m \"submodule initial\"\n \t) &&\n \techo 1 >file1 &&\n-\tgit add file1 sub\n+\tgit add file1 sub &&\n \ttest_tick &&\n \tgit commit -m \"One\" &&\n \techo 2 >file1 &&\ndiff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh\nindex 8a676a5..414b09b 100755\n--- a/t/t4124-apply-ws-rule.sh\n+++ b/t/t4124-apply-ws-rule.sh\n@@ -368,7 +368,7 @@ test_expect_success 'missing blanks at EOF must only match blank lines' '\n \tgit diff -- one >patch &&\n \n \techo a >one &&\n-\ttest_must_fail git apply patch\n+\ttest_must_fail git apply patch &&\n \ttest_must_fail git apply --whitespace=fix patch &&\n \ttest_must_fail git apply --ignore-space-change --whitespace=fix patch\n '\n@@ -419,7 +419,7 @@ test_expect_success 'same, but with CR-LF line endings && cr-at-eol set' '\n \tprintf \"b\\r\\n\" >>one &&\n \tprintf \"c\\r\\n\" >>one &&\n \tcp one save-one &&\n-\tprintf \"                 \\r\\n\" >>one\n+\tprintf \"                 \\r\\n\" >>one &&\n \tgit add one &&\n \tprintf \"d\\r\\n\" >>one &&\n \tcp one expect &&\n@@ -436,7 +436,7 @@ test_expect_success 'same, but with CR-LF line endings && cr-at-eol unset' '\n \tprintf \"b\\r\\n\" >>one &&\n \tprintf \"c\\r\\n\" >>one &&\n \tcp one save-one &&\n-\tprintf \"                 \\r\\n\" >>one\n+\tprintf \"                 \\r\\n\" >>one &&\n \tgit add one &&\n \tcp one expect &&\n \tprintf \"d\\r\\n\" >>one &&\ndiff --git a/t/t5503-tagfollow.sh b/t/t5503-tagfollow.sh\nindex 8a298a6..7f6d3d2 100755\n--- a/t/t5503-tagfollow.sh\n+++ b/t/t5503-tagfollow.sh\n@@ -54,7 +54,7 @@ EOF\n '\n \n test_expect_success NOT_MINGW 'fetch A (new commit : 1 connection)' '\n-\trm -f $U\n+\trm -f $U &&\n \t(\n \t\tcd cloned &&\n \t\tGIT_DEBUG_SEND_PACK=3 git fetch 3>../$U &&\n@@ -87,7 +87,7 @@ EOF\n '\n \n test_expect_success NOT_MINGW 'fetch C, T (new branch, tag : 1 connection)' '\n-\trm -f $U\n+\trm -f $U &&\n \t(\n \t\tcd cloned &&\n \t\tGIT_DEBUG_SEND_PACK=3 git fetch 3>../$U &&\n@@ -126,7 +126,7 @@ EOF\n '\n \n test_expect_success NOT_MINGW 'fetch B, S (commit and tag : 1 connection)' '\n-\trm -f $U\n+\trm -f $U &&\n \t(\n \t\tcd cloned &&\n \t\tGIT_DEBUG_SEND_PACK=3 git fetch 3>../$U &&\ndiff --git a/t/t5701-clone-local.sh b/t/t5701-clone-local.sh\nindex 8b4c356..0f4d487 100755\n--- a/t/t5701-clone-local.sh\n+++ b/t/t5701-clone-local.sh\n@@ -10,11 +10,11 @@ test_expect_success 'preparing origin repository' '\n \tgit clone --bare . a.git &&\n \tgit clone --bare . x &&\n \ttest \"$(GIT_CONFIG=a.git/config git config --bool core.bare)\" = true &&\n-\ttest \"$(GIT_CONFIG=x/config git config --bool core.bare)\" = true\n+\ttest \"$(GIT_CONFIG=x/config git config --bool core.bare)\" = true &&\n \tgit bundle create b1.bundle --all &&\n \tgit bundle create b2.bundle master &&\n \tmkdir dir &&\n-\tcp b1.bundle dir/b3\n+\tcp b1.bundle dir/b3 &&\n \tcp b1.bundle b4\n '\n \n@@ -112,7 +112,7 @@ test_expect_success 'bundle clone with nonexistent HEAD' '\n \tcd \"$D\" &&\n \tgit clone b2.bundle b2 &&\n \tcd b2 &&\n-\tgit fetch\n+\tgit fetch &&\n \ttest ! -e .git/refs/heads/master\n '\n \ndiff --git a/t/t7001-mv.sh b/t/t7001-mv.sh\nindex 624e6d2..a845b15 100755\n--- a/t/t7001-mv.sh\n+++ b/t/t7001-mv.sh\n@@ -207,7 +207,7 @@ test_expect_success 'git mv should not change sha1 of moved cache entry' '\n \tgit init &&\n \techo 1 >dirty &&\n \tgit add dirty &&\n-\tentry=\"$(git ls-files --stage dirty | cut -f 1)\"\n+\tentry=\"$(git ls-files --stage dirty | cut -f 1)\" &&\n \tgit mv dirty dirty2 &&\n \t[ \"$entry\" = \"$(git ls-files --stage dirty2 | cut -f 1)\" ] &&\n \techo 2 >dirty2 &&\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex ac943f5..d05f421 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -1097,7 +1097,7 @@ hash1=$(git rev-parse HEAD)\n test_expect_success 'creating second commit and tag' '\n \techo foo-2.0 >foo &&\n \tgit add foo &&\n-\tgit commit -m second\n+\tgit commit -m second &&\n \tgit tag v2.0\n '\n \n@@ -1122,18 +1122,18 @@ v2.0\n EOF\n \n test_expect_success 'checking that first commit is in all tags (hash)' \"\n-\tgit tag -l --contains $hash1 v* >actual\n+\tgit tag -l --contains $hash1 v* >actual &&\n \ttest_cmp expected actual\n \"\n \n # other ways of specifying the commit\n test_expect_success 'checking that first commit is in all tags (tag)' \"\n-\tgit tag -l --contains v1.0 v* >actual\n+\tgit tag -l --contains v1.0 v* >actual &&\n \ttest_cmp expected actual\n \"\n \n test_expect_success 'checking that first commit is in all tags (relative)' \"\n-\tgit tag -l --contains HEAD~2 v* >actual\n+\tgit tag -l --contains HEAD~2 v* >actual &&\n \ttest_cmp expected actual\n \"\n \n@@ -1142,7 +1142,7 @@ v2.0\n EOF\n \n test_expect_success 'checking that second commit only has one tag' \"\n-\tgit tag -l --contains $hash2 v* >actual\n+\tgit tag -l --contains $hash2 v* >actual &&\n \ttest_cmp expected actual\n \"\n \n@@ -1151,7 +1151,7 @@ cat > expected <<EOF\n EOF\n \n test_expect_success 'checking that third commit has no tags' \"\n-\tgit tag -l --contains $hash3 v* >actual\n+\tgit tag -l --contains $hash3 v* >actual &&\n \ttest_cmp expected actual\n \"\n \n@@ -1161,7 +1161,7 @@ test_expect_success 'creating simple branch' '\n \tgit branch stable v2.0 &&\n         git checkout stable &&\n \techo foo-3.0 > foo &&\n-\tgit commit foo -m fourth\n+\tgit commit foo -m fourth &&\n \tgit tag v3.0\n '\n \n@@ -1172,7 +1172,7 @@ v3.0\n EOF\n \n test_expect_success 'checking that branch head only has one tag' \"\n-\tgit tag -l --contains $hash4 v* >actual\n+\tgit tag -l --contains $hash4 v* >actual &&\n \ttest_cmp expected actual\n \"\n \n@@ -1186,7 +1186,7 @@ v4.0\n EOF\n \n test_expect_success 'checking that original branch head has one tag now' \"\n-\tgit tag -l --contains $hash3 v* >actual\n+\tgit tag -l --contains $hash3 v* >actual &&\n \ttest_cmp expected actual\n \"\n \n@@ -1201,18 +1201,18 @@ v4.0\n EOF\n \n test_expect_success 'checking that initial commit is in all tags' \"\n-\tgit tag -l --contains $hash1 v* >actual\n+\tgit tag -l --contains $hash1 v* >actual &&\n \ttest_cmp expected actual\n \"\n \n # mixing modes and options:\n \n test_expect_success 'mixing incompatibles modes and options is forbidden' '\n-\ttest_must_fail git tag -a\n-\ttest_must_fail git tag -l -v\n-\ttest_must_fail git tag -n 100\n-\ttest_must_fail git tag -l -m msg\n-\ttest_must_fail git tag -l -F some file\n+\ttest_must_fail git tag -a &&\n+\ttest_must_fail git tag -l -v &&\n+\ttest_must_fail git tag -n 100 &&\n+\ttest_must_fail git tag -l -m msg &&\n+\ttest_must_fail git tag -l -F some file &&\n \ttest_must_fail git tag -v -s\n '\n \ndiff --git a/t/t7300-clean.sh b/t/t7300-clean.sh\nindex 6c776e9..c802ef8 100755\n--- a/t/t7300-clean.sh\n+++ b/t/t7300-clean.sh\n@@ -183,7 +183,7 @@ test_expect_success 'git clean symbolic link' '\n \n \tmkdir -p build docs &&\n \ttouch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n-\tln -s docs/manual.txt src/part4.c\n+\tln -s docs/manual.txt src/part4.c &&\n \tgit clean &&\n \ttest -f Makefile &&\n \ttest -f README &&\ndiff --git a/t/t7502-commit.sh b/t/t7502-commit.sh\nindex c1c6645..50da034 100755\n--- a/t/t7502-commit.sh\n+++ b/t/t7502-commit.sh\n@@ -390,7 +390,7 @@ try_commit_status_combo () {\n \n \ttest_expect_success 'commit --no-status' '\n \t\tclear_config commit.status &&\n-\t\ttry_commit --no-status\n+\t\ttry_commit --no-status &&\n \t\t! grep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \ndiff --git a/t/t7700-repack.sh b/t/t7700-repack.sh\nindex c2f66ff..d954b84 100755\n--- a/t/t7700-repack.sh\n+++ b/t/t7700-repack.sh\n@@ -56,7 +56,7 @@ test_expect_success 'loose objects in alternate ODB are not repacked' '\n '\n \n test_expect_success 'packed obs in alt ODB are repacked even when local repo is packless' '\n-\tmkdir alt_objects/pack\n+\tmkdir alt_objects/pack &&\n \tmv .git/objects/pack/* alt_objects/pack &&\n \tgit repack -a &&\n \tmyidx=$(ls -1 .git/objects/pack/*.idx) &&\n@@ -95,14 +95,14 @@ test_expect_success 'packed obs in alternate ODB kept pack are repacked' '\n \t# swap the .keep so the commit object is in the pack with .keep\n \tfor p in alt_objects/pack/*.pack\n \tdo\n-\t\tbase_name=$(basename $p .pack)\n+\t\tbase_name=$(basename $p .pack) &&\n \t\tif test -f alt_objects/pack/$base_name.keep\n \t\tthen\n \t\t\trm alt_objects/pack/$base_name.keep\n \t\telse\n \t\t\ttouch alt_objects/pack/$base_name.keep\n \t\tfi\n-\tdone\n+\tdone &&\n \tgit repack -a -d &&\n \tmyidx=$(ls -1 .git/objects/pack/*.idx) &&\n \ttest -f \"$myidx\" &&\ndiff --git a/t/t9146-git-svn-empty-dirs.sh b/t/t9146-git-svn-empty-dirs.sh\nindex 565365c..158c8e3 100755\n--- a/t/t9146-git-svn-empty-dirs.sh\n+++ b/t/t9146-git-svn-empty-dirs.sh\n@@ -33,7 +33,7 @@ test_expect_success 'more emptiness' '\n '\n \n test_expect_success 'git svn rebase creates empty directory' '\n-\t( cd cloned && git svn rebase )\n+\t( cd cloned && git svn rebase ) &&\n \ttest -d cloned/\"! !\"\n '\n \n-- \n1.7.2.3.557.gab647.dirty\n"},{"id":"154871","messageId":"20101031073350.GC11483@burratino","threadId":"25321","inReplyTo":"20101031072640.GA11483@burratino","subject":"[RFC/PATCH 02/10] test-lib: introduce test_line_count to measure files","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-31T07:33:50Z","receivedAt":"2010-10-31T07:33:50Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Some tests check their output with code like the following:\n\n\ttest \"$(git ls-files -u B | wc -l)\" -eq 3 || {\n\t\techo \"BAD: should have left stages for B\"\n\t\treturn 1\n\t}\n\nThe verbose failure condition is used because test, unlike\ndiff, does not print any useful information about the\nnature of the failure when it fails.\n\nIntroduce a test_line_count function to help. If used like\n\n\tgit ls-files -u B >output &&\n\ttest_line_count -eq 3 output\n\nit will produce output like\n\n\ttest_line_count: line count for output !-eq 3\n\t100644 b023018cabc396e7692c70bbf5784a93d3f738ab 2\thi.c\n\t100644 45b983be36b73c0788dc9cbcb76cbb80fc7bb057 3\thi.c\n\non failure.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nI don't imagine this would be too helpful for new tests,\nbut the idiom is common enough in old tests that maybe I'm\nwrong about that.\n\n t/README      |    4 ++++\n t/test-lib.sh |   22 ++++++++++++++++++++++\n 2 files changed, 26 insertions(+), 0 deletions(-)\n\ndiff --git a/t/README b/t/README\nindex 2aceb67..1a78982 100644\n--- a/t/README\n+++ b/t/README\n@@ -500,6 +500,10 @@ library for your script to use.\n    <expected> file.  This behaves like \"cmp\" but produces more\n    helpful output when the test is run with \"-v\" option.\n \n+ - test_line_count (= | -lt | -ge | ...) <length> <file>\n+\n+   Check whether a file has the length it is expected to.\n+\n  - test_path_is_file <file> [<diagnosis>]\n    test_path_is_dir <dir> [<diagnosis>]\n    test_path_is_missing <path> [<diagnosis>]\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 87308f5..a417bdf 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -598,6 +598,28 @@ test_path_is_missing () {\n \tfi\n }\n \n+# test_line_count checks that a file has the number of lines it\n+# ought to. For example:\n+#\n+#\ttest_expect_success 'produce exactly one line of output' '\n+#\t\tdo something >output &&\n+#\t\ttest_line_count = 1 output\n+#\t'\n+#\n+# is like \"test $(wc -l <output) = 1\" except that it passes the\n+# output through when the number of lines is wrong.\n+\n+test_line_count () {\n+\tif test $# != 3\n+\tthen\n+\t\terror \"bug in the test script: not 3 parameters to test_line_count\"\n+\telif ! test $(wc -l <\"$3\") \"$1\" \"$2\"\n+\tthen\n+\t\techo \"test_line_count: line count for $3 !$1 $2\"\n+\t\tcat \"$3\"\n+\t\treturn 1\n+\tfi\n+}\n \n # This is not among top-level (test_expect_success | test_expect_failure)\n # but is a prefix that can be used in the test script, like:\n-- \n1.7.2.3.557.gab647.dirty\n"},{"id":"154872","messageId":"20101031073444.GD11483@burratino","threadId":"25321","inReplyTo":"20101031072640.GA11483@burratino","subject":"[PATCH 03/10] t6022 (renaming merge): chain test commands with &&","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-31T07:34:44Z","receivedAt":"2010-10-31T07:34:44Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Using 'return' in an attempt to end a test assertion can have\nunpredictable results (probably escaping from test_run_ and breaking\nits bookkeeping).  Redo the control flow using helpers like\ntest_expect_code and git diff --exit-code, so each test assertion can\nfollow the usual form\n\n\tcommand that should succeed &&\n\tcommand that should succeed &&\n\tcommand that should succeed &&\n\t...\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/t6022-merge-rename.sh |  282 +++++++++++++++-------------------------------\n 1 files changed, 92 insertions(+), 190 deletions(-)\n\ndiff --git a/t/t6022-merge-rename.sh b/t/t6022-merge-rename.sh\nindex b66544b..83efc7a 100755\n--- a/t/t6022-merge-rename.sh\n+++ b/t/t6022-merge-rename.sh\n@@ -94,245 +94,147 @@ git checkout master'\n \n test_expect_success 'pull renaming branch into unrenaming one' \\\n '\n-\tgit show-branch\n-\tgit pull . white && {\n-\t\techo \"BAD: should have conflicted\"\n-\t\treturn 1\n-\t}\n-\tgit ls-files -s\n-\ttest \"$(git ls-files -u B | wc -l)\" -eq 3 || {\n-\t\techo \"BAD: should have left stages for B\"\n-\t\treturn 1\n-\t}\n-\ttest \"$(git ls-files -s N | wc -l)\" -eq 1 || {\n-\t\techo \"BAD: should have merged N\"\n-\t\treturn 1\n-\t}\n+\tgit show-branch &&\n+\ttest_expect_code 1 git pull . white &&\n+\tgit ls-files -s &&\n+\tgit ls-files -u B >b.stages &&\n+\ttest_line_count = 3 b.stages &&\n+\tgit ls-files -s N >n.stages &&\n+\ttest_line_count = 1 n.stages &&\n \tsed -ne \"/^g/{\n \tp\n \tq\n-\t}\" B | grep master || {\n-\t\techo \"BAD: should have listed our change first\"\n-\t\treturn 1\n-\t}\n-\ttest \"$(git diff white N | wc -l)\" -eq 0 || {\n-\t\techo \"BAD: should have taken colored branch\"\n-\t\treturn 1\n-\t}\n+\t}\" B | grep master &&\n+\tgit diff --exit-code white N\n '\n \n test_expect_success 'pull renaming branch into another renaming one' \\\n '\n-\trm -f B\n-\tgit reset --hard\n-\tgit checkout red\n-\tgit pull . white && {\n-\t\techo \"BAD: should have conflicted\"\n-\t\treturn 1\n-\t}\n-\ttest \"$(git ls-files -u B | wc -l)\" -eq 3 || {\n-\t\techo \"BAD: should have left stages\"\n-\t\treturn 1\n-\t}\n-\ttest \"$(git ls-files -s N | wc -l)\" -eq 1 || {\n-\t\techo \"BAD: should have merged N\"\n-\t\treturn 1\n-\t}\n+\trm -f B &&\n+\tgit reset --hard &&\n+\tgit checkout red &&\n+\ttest_expect_code 1 git pull . white &&\n+\tgit ls-files -u B >b.stages &&\n+\ttest_line_count = 3 b.stages &&\n+\tgit ls-files -s N >n.stages &&\n+\ttest_line_count = 1 n.stages &&\n \tsed -ne \"/^g/{\n \tp\n \tq\n-\t}\" B | grep red || {\n-\t\techo \"BAD: should have listed our change first\"\n-\t\treturn 1\n-\t}\n-\ttest \"$(git diff white N | wc -l)\" -eq 0 || {\n-\t\techo \"BAD: should have taken colored branch\"\n-\t\treturn 1\n-\t}\n+\t}\" B | grep red &&\n+\tgit diff --exit-code white N\n '\n \n test_expect_success 'pull unrenaming branch into renaming one' \\\n '\n-\tgit reset --hard\n-\tgit show-branch\n-\tgit pull . master && {\n-\t\techo \"BAD: should have conflicted\"\n-\t\treturn 1\n-\t}\n-\ttest \"$(git ls-files -u B | wc -l)\" -eq 3 || {\n-\t\techo \"BAD: should have left stages\"\n-\t\treturn 1\n-\t}\n-\ttest \"$(git ls-files -s N | wc -l)\" -eq 1 || {\n-\t\techo \"BAD: should have merged N\"\n-\t\treturn 1\n-\t}\n+\tgit reset --hard &&\n+\tgit show-branch &&\n+\ttest_expect_code 1 git pull . master &&\n+\tgit ls-files -u B >b.stages &&\n+\ttest_line_count = 3 b.stages &&\n+\tgit ls-files -s N >n.stages &&\n+\ttest_line_count = 1 n.stages &&\n \tsed -ne \"/^g/{\n \tp\n \tq\n-\t}\" B | grep red || {\n-\t\techo \"BAD: should have listed our change first\"\n-\t\treturn 1\n-\t}\n-\ttest \"$(git diff white N | wc -l)\" -eq 0 || {\n-\t\techo \"BAD: should have taken colored branch\"\n-\t\treturn 1\n-\t}\n+\t}\" B | grep red &&\n+\tgit diff --exit-code white N\n '\n \n test_expect_success 'pull conflicting renames' \\\n '\n-\tgit reset --hard\n-\tgit show-branch\n-\tgit pull . blue && {\n-\t\techo \"BAD: should have conflicted\"\n-\t\treturn 1\n-\t}\n-\ttest \"$(git ls-files -u A | wc -l)\" -eq 1 || {\n-\t\techo \"BAD: should have left a stage\"\n-\t\treturn 1\n-\t}\n-\ttest \"$(git ls-files -u B | wc -l)\" -eq 1 || {\n-\t\techo \"BAD: should have left a stage\"\n-\t\treturn 1\n-\t}\n-\ttest \"$(git ls-files -u C | wc -l)\" -eq 1 || {\n-\t\techo \"BAD: should have left a stage\"\n-\t\treturn 1\n-\t}\n-\ttest \"$(git ls-files -s N | wc -l)\" -eq 1 || {\n-\t\techo \"BAD: should have merged N\"\n-\t\treturn 1\n-\t}\n+\tgit reset --hard &&\n+\tgit show-branch &&\n+\ttest_expect_code 1 git pull . blue &&\n+\tgit ls-files -u A >a.stages &&\n+\ttest_line_count = 1 a.stages &&\n+\tgit ls-files -u B >b.stages &&\n+\ttest_line_count = 1 b.stages &&\n+\tgit ls-files -u C >c.stages &&\n+\ttest_line_count = 1 c.stages &&\n+\tgit ls-files -s N >n.stages &&\n+\ttest_line_count = 1 n.stages &&\n \tsed -ne \"/^g/{\n \tp\n \tq\n-\t}\" B | grep red || {\n-\t\techo \"BAD: should have listed our change first\"\n-\t\treturn 1\n-\t}\n-\ttest \"$(git diff white N | wc -l)\" -eq 0 || {\n-\t\techo \"BAD: should have taken colored branch\"\n-\t\treturn 1\n-\t}\n+\t}\" B | grep red &&\n+\tgit diff --exit-code white N\n '\n \n test_expect_success 'interference with untracked working tree file' '\n-\n-\tgit reset --hard\n-\tgit show-branch\n-\techo >A this file should not matter\n-\tgit pull . white && {\n-\t\techo \"BAD: should have conflicted\"\n-\t\treturn 1\n-\t}\n-\ttest -f A || {\n-\t\techo \"BAD: should have left A intact\"\n-\t\treturn 1\n-\t}\n+\tgit reset --hard &&\n+\tgit show-branch &&\n+\techo >A this file should not matter &&\n+\ttest_expect_code 1 git pull . white &&\n+\ttest_path_is_file A\n '\n \n test_expect_success 'interference with untracked working tree file' '\n-\n-\tgit reset --hard\n-\tgit checkout white\n-\tgit show-branch\n-\trm -f A\n-\techo >A this file should not matter\n-\tgit pull . red && {\n-\t\techo \"BAD: should have conflicted\"\n-\t\treturn 1\n-\t}\n-\ttest -f A || {\n-\t\techo \"BAD: should have left A intact\"\n-\t\treturn 1\n-\t}\n+\tgit reset --hard &&\n+\tgit checkout white &&\n+\tgit show-branch &&\n+\trm -f A &&\n+\techo >A this file should not matter &&\n+\ttest_expect_code 1 git pull . red &&\n+\ttest_path_is_file A\n '\n \n test_expect_success 'interference with untracked working tree file' '\n-\n-\tgit reset --hard\n-\trm -f A M\n-\tgit checkout -f master\n-\tgit tag -f anchor\n-\tgit show-branch\n-\tgit pull . yellow || {\n-\t\techo \"BAD: should have cleanly merged\"\n-\t\treturn 1\n-\t}\n-\ttest -f M && {\n-\t\techo \"BAD: should have removed M\"\n-\t\treturn 1\n-\t}\n+\tgit reset --hard &&\n+\trm -f A M &&\n+\tgit checkout -f master &&\n+\tgit tag -f anchor &&\n+\tgit show-branch &&\n+\tgit pull . yellow &&\n+\ttest_path_is_missing M &&\n \tgit reset --hard anchor\n '\n \n test_expect_success 'updated working tree file should prevent the merge' '\n-\n-\tgit reset --hard\n-\trm -f A M\n-\tgit checkout -f master\n-\tgit tag -f anchor\n-\tgit show-branch\n-\techo >>M one line addition\n-\tcat M >M.saved\n-\tgit pull . yellow && {\n-\t\techo \"BAD: should have complained\"\n-\t\treturn 1\n-\t}\n-\ttest_cmp M M.saved || {\n-\t\techo \"BAD: should have left M intact\"\n-\t\treturn 1\n-\t}\n+\tgit reset --hard &&\n+\trm -f A M &&\n+\tgit checkout -f master &&\n+\tgit tag -f anchor &&\n+\tgit show-branch &&\n+\techo >>M one line addition &&\n+\tcat M >M.saved &&\n+\ttest_expect_code 128 git pull . yellow &&\n+\ttest_cmp M M.saved &&\n \trm -f M.saved\n '\n \n test_expect_success 'updated working tree file should prevent the merge' '\n-\n-\tgit reset --hard\n-\trm -f A M\n-\tgit checkout -f master\n-\tgit tag -f anchor\n-\tgit show-branch\n-\techo >>M one line addition\n-\tcat M >M.saved\n-\tgit update-index M\n-\tgit pull . yellow && {\n-\t\techo \"BAD: should have complained\"\n-\t\treturn 1\n-\t}\n-\ttest_cmp M M.saved || {\n-\t\techo \"BAD: should have left M intact\"\n-\t\treturn 1\n-\t}\n+\tgit reset --hard &&\n+\trm -f A M &&\n+\tgit checkout -f master &&\n+\tgit tag -f anchor &&\n+\tgit show-branch &&\n+\techo >>M one line addition &&\n+\tcat M >M.saved &&\n+\tgit update-index M &&\n+\ttest_expect_code 128 git pull . yellow &&\n+\ttest_cmp M M.saved &&\n \trm -f M.saved\n '\n \n test_expect_success 'interference with untracked working tree file' '\n-\n-\tgit reset --hard\n-\trm -f A M\n-\tgit checkout -f yellow\n-\tgit tag -f anchor\n-\tgit show-branch\n-\techo >M this file should not matter\n-\tgit pull . master || {\n-\t\techo \"BAD: should have cleanly merged\"\n-\t\treturn 1\n-\t}\n-\ttest -f M || {\n-\t\techo \"BAD: should have left M intact\"\n-\t\treturn 1\n-\t}\n-\tgit ls-files -s | grep M && {\n-\t\techo \"BAD: M must be untracked in the result\"\n-\t\treturn 1\n-\t}\n+\tgit reset --hard &&\n+\trm -f A M &&\n+\tgit checkout -f yellow &&\n+\tgit tag -f anchor &&\n+\tgit show-branch &&\n+\techo >M this file should not matter &&\n+\tgit pull . master &&\n+\ttest_path_is_file M &&\n+\t! {\n+\t\tgit ls-files -s |\n+\t\tgrep M\n+\t} &&\n \tgit reset --hard anchor\n '\n \n test_expect_success 'merge of identical changes in a renamed file' '\n-\trm -f A M N\n+\trm -f A M N &&\n \tgit reset --hard &&\n \tgit checkout change+rename &&\n \tGIT_MERGE_VERBOSITY=3 git merge change | grep \"^Skipped B\" &&\n-- \n1.7.2.3.557.gab647.dirty\n"},{"id":"154873","messageId":"20101031073549.GE11483@burratino","threadId":"25321","inReplyTo":"20101031072640.GA11483@burratino","subject":"[PATCH 04/10] t1502 (rev-parse --parseopt): test exit code from \"-h\"","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-31T07:35:49Z","receivedAt":"2010-10-31T07:35:49Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"rev-parse --parseopt exits with code 129 (usage error) when asked\nto dump usage with -h on behalf of another command.  Scripts can\ntake advantage of this to avoid trying to parse usage information\nas though it were the regular output from some git command.\n\nNoticed with an &&-chaining tester.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/t1502-rev-parse-parseopt.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t1502-rev-parse-parseopt.sh b/t/t1502-rev-parse-parseopt.sh\nindex b3195c4..1efd7f7 100755\n--- a/t/t1502-rev-parse-parseopt.sh\n+++ b/t/t1502-rev-parse-parseopt.sh\n@@ -40,7 +40,7 @@ extra1    line above used to cause a segfault but no longer does\n EOF\n \n test_expect_success 'test --parseopt help output' '\n-\tgit rev-parse --parseopt -- -h > output < optionspec\n+\ttest_expect_code 129 git rev-parse --parseopt -- -h > output < optionspec &&\n \ttest_cmp expect output\n '\n \n-- \n1.7.2.3.557.gab647.dirty\n"},{"id":"154874","messageId":"20101031073619.GF11483@burratino","threadId":"25321","inReplyTo":"20101031072640.GA11483@burratino","subject":"[PATCH 05/10] t1400 (update-ref): use test_must_fail","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-31T07:36:19Z","receivedAt":"2010-10-31T07:36:19Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"As t/README explains:\n\n\tWhen a gitcommand dies due to a segfault, test_must_fail\n\tdiagnoses it as an error; \"! git <command>\" treats it as\n\tjust another expected failure, which would let such a bug\n\tgo unnoticed.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/t1400-update-ref.sh |    5 ++---\n 1 files changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh\nindex d17551e..ff747f8 100755\n--- a/t/t1400-update-ref.sh\n+++ b/t/t1400-update-ref.sh\n@@ -52,9 +52,8 @@ rm -f .git/$m\n \n test_expect_success \\\n \t\"fail to create $n\" \\\n-\t\"touch .git/$n_dir\n-\t git update-ref $n $A >out 2>err\"'\n-\t test $? != 0'\n+\t\"touch .git/$n_dir &&\n+\t test_must_fail git update-ref $n $A >out 2>err\"\n rm -f .git/$n_dir out err\n \n test_expect_success \\\n-- \n1.7.2.3.557.gab647.dirty\n"},{"id":"154875","messageId":"20101031073657.GG11483@burratino","threadId":"25321","inReplyTo":"20101031072640.GA11483@burratino","subject":"[PATCH 06/10] t3301 (notes): use test_expect_code for clarity","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-31T07:36:57Z","receivedAt":"2010-10-31T07:36:57Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Use the test_expect_code helper instead of open-coding it.\n\nThe main behavior change is to print the command and actual exit\nstatus when the test fails.  More importantly, this would make it\neasier to add commands before \"git notes show\" as part of the\nsame test assertion if needed.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/t3301-notes.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t3301-notes.sh b/t/t3301-notes.sh\nindex 6931171..7e84ab9 100755\n--- a/t/t3301-notes.sh\n+++ b/t/t3301-notes.sh\n@@ -52,7 +52,7 @@ test_expect_success 'refusing to edit notes in refs/remotes/' '\n \n # 1 indicates caught gracefully by die, 128 means git-show barked\n test_expect_success 'handle empty notes gracefully' '\n-\tgit notes show ; test 1 = $?\n+\ttest_expect_code 1 git notes show\n '\n \n test_expect_success 'show non-existent notes entry with %N' '\n-- \n1.7.2.3.557.gab647.dirty\n"},{"id":"154876","messageId":"20101031073825.GH11483@burratino","threadId":"25321","inReplyTo":"20101031072640.GA11483@burratino","subject":"[PATCH 07/10] t3404 (rebase -i): unroll test_commit loops","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-31T07:38:25Z","receivedAt":"2010-10-31T07:38:25Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Allow test_commit failures in loop iterations before the last one to\ncause the test assertion to fail.\n\nMore importantly, avoiding these loops makes the test a little\nsimpler to read and decreases the vertical screen footprint of\nthe setup test assertion by one line.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/t3404-rebase-interactive.sh |   23 +++++++++++------------\n 1 files changed, 11 insertions(+), 12 deletions(-)\n\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex c0e69f6..b372314 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -48,20 +48,19 @@ test_expect_success 'setup' '\n \tgit checkout -b branch2 F &&\n \ttest_commit I file6 &&\n \tgit checkout -b conflict-branch A &&\n-\tfor n in one two three four\n-\tdo\n-\t\ttest_commit $n conflict\n-\tdone &&\n+\ttest_commit one conflict &&\n+\ttest_commit two conflict &&\n+\ttest_commit three conflict &&\n+\ttest_commit four conflict &&\n \tgit checkout -b no-conflict-branch A &&\n-\tfor n in J K L M\n-\tdo\n-\t\ttest_commit $n file$n\n-\tdone &&\n+\ttest_commit J fileJ &&\n+\ttest_commit K fileK &&\n+\ttest_commit L fileL &&\n+\ttest_commit M fileM &&\n \tgit checkout -b no-ff-branch A &&\n-\tfor n in N O P\n-\tdo\n-\t\ttest_commit $n file$n\n-\tdone\n+\ttest_commit N fileN &&\n+\ttest_commit O fileO &&\n+\ttest_commit P fileP\n '\n \n # \"exec\" commands are ran with the user shell by default, but this may\n-- \n1.7.2.3.557.gab647.dirty\n"},{"id":"154877","messageId":"20101031073951.GI11483@burratino","threadId":"25321","inReplyTo":"20101031072640.GA11483@burratino","subject":"[PATCH 08/10] t3404 (rebase -i): move comment to description","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-31T07:39:51Z","receivedAt":"2010-10-31T07:39:51Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Add a comment describing the setup in t3404 to its --help output.\n\nThis should make it easier to decide where to put new functions\nwithout disrupting the flow of the file or obstructing the description\nof the test setup.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/t3404-rebase-interactive.sh |   35 +++++++++++++++++------------------\n 1 files changed, 17 insertions(+), 18 deletions(-)\n\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex b372314..4097a2d 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -7,6 +7,23 @@ test_description='git rebase interactive\n \n This test runs git rebase \"interactively\", by faking an edit, and verifies\n that the result still makes sense.\n+\n+Initial setup:\n+\n+     one - two - three - four (conflict-branch)\n+   /\n+ A - B - C - D - E            (master)\n+ | \\\n+ |   F - G - H                (branch1)\n+ |     \\\n+ |\\      I                    (branch2)\n+ | \\\n+ |   J - K - L - M            (no-conflict-branch)\n+  \\\n+    N - O - P                 (no-ff-branch)\n+\n+ where A, B, D and G all touch file1, and one, two, three, four all\n+ touch file \"conflict\".\n '\n . ./test-lib.sh\n \n@@ -14,27 +31,9 @@ that the result still makes sense.\n \n set_fake_editor\n \n-# Set up the repository like this:\n-#\n-#     one - two - three - four (conflict-branch)\n-#   /\n-# A - B - C - D - E            (master)\n-# | \\\n-# |   F - G - H                (branch1)\n-# |     \\\n-# |\\      I                    (branch2)\n-# | \\\n-# |   J - K - L - M            (no-conflict-branch)\n-#  \\\n-#    N - O - P                 (no-ff-branch)\n-#\n-# where A, B, D and G all touch file1, and one, two, three, four all\n-# touch file \"conflict\".\n-#\n # WARNING: Modifications to the initial repository can change the SHA ID used\n # in the expect2 file for the 'stop on conflicting pick' test.\n \n-\n test_expect_success 'setup' '\n \ttest_commit A file1 &&\n \ttest_commit B file1 &&\n-- \n1.7.2.3.557.gab647.dirty\n"},{"id":"154878","messageId":"20101031074030.GJ11483@burratino","threadId":"25321","inReplyTo":"20101031072640.GA11483@burratino","subject":"[PATCH 09/10] t3404 (rebase -i): introduce helper to check position of HEAD","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-31T07:40:30Z","receivedAt":"2010-10-31T07:40:30Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"The same code to check the position of HEAD is used by several\ntests in this script.  Factor it out as a function and simplify it.\n\nNoticed using an &&-chaining tester, because the current code\ndoes not propagate the precise exit status from errors.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/t3404-rebase-interactive.sh |   24 +++++++++---------------\n 1 files changed, 9 insertions(+), 15 deletions(-)\n\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 4097a2d..4fcedda 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -29,6 +29,12 @@ Initial setup:\n \n . \"$TEST_DIRECTORY\"/lib-rebase.sh\n \n+test_cmp_rev () {\n+\tgit describe --always --tags \"$1\" >expect.rev &&\n+\tgit describe --always --tags \"$2\" >actual.rev &&\n+\ttest_cmp expect.rev actual.rev\n+}\n+\n set_fake_editor\n \n # WARNING: Modifications to the initial repository can change the SHA ID used\n@@ -80,20 +86,12 @@ test_expect_success 'rebase -i with the exec command' '\n \ttest_path_is_file touch-one &&\n \ttest_path_is_file touch-two &&\n \ttest_path_is_missing touch-three \" (should have stopped before)\" &&\n-\ttest $(git rev-parse C) = $(git rev-parse HEAD) || {\n-\t\techo \"Stopped at wrong revision:\"\n-\t\techo \"($(git describe --tags HEAD) instead of C)\"\n-\t\tfalse\n-\t} &&\n+\ttest_cmp_rev C HEAD &&\n \tgit rebase --continue &&\n \ttest_path_is_file touch-three &&\n \ttest_path_is_file \"touch-file  name with spaces\" &&\n \ttest_path_is_file touch-after-semicolon &&\n-\ttest $(git rev-parse master) = $(git rev-parse HEAD) || {\n-\t\techo \"Stopped at wrong revision:\"\n-\t\techo \"($(git describe --tags HEAD) instead of master)\"\n-\t\tfalse\n-\t} &&\n+\ttest_cmp_rev master HEAD &&\n \trm -f touch-*\n '\n \n@@ -114,11 +112,7 @@ test_expect_success 'rebase -i with the exec command checks tree cleanness' '\n \texport FAKE_LINES &&\n \ttest_must_fail git rebase -i HEAD^\n \t) &&\n-\ttest $(git rev-parse master^) = $(git rev-parse HEAD) || {\n-\t\techo \"Stopped at wrong revision:\"\n-\t\techo \"($(git describe --tags HEAD) instead of master^)\"\n-\t\tfalse\n-\t} &&\n+\ttest_cmp_rev master^ HEAD &&\n \tgit reset --hard &&\n \tgit rebase --continue\n '\n-- \n1.7.2.3.557.gab647.dirty\n"},{"id":"154879","messageId":"20101031074108.GK11483@burratino","threadId":"25321","inReplyTo":"20101031072640.GA11483@burratino","subject":"[PATCH 10/10] t4124 (apply --whitespace): use test_might_fail","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-31T07:41:08Z","receivedAt":"2010-10-31T07:41:08Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Use test_might_fail instead of ignoring the exit status from git\nconfig --unset, and let the exit status propagate past rm -f (which\ndoes not fail on ENOENT).  Otherwise bugs that lead git config to\ncrash would not be detected when this test runs.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/t4124-apply-ws-rule.sh |    5 ++---\n 1 files changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh\nindex 414b09b..61bfc56 100755\n--- a/t/t4124-apply-ws-rule.sh\n+++ b/t/t4124-apply-ws-rule.sh\n@@ -176,9 +176,8 @@ test_expect_success 'trailing whitespace & no newline at the end of file' '\n '\n \n test_expect_success 'blank at EOF with --whitespace=fix (1)' '\n-\t: these can fail depending on what we did before\n-\tgit config --unset core.whitespace\n-\trm -f .gitattributes\n+\ttest_might_fail git config --unset core.whitespace &&\n+\trm -f .gitattributes &&\n \n \t{ echo a; echo b; echo c; } >one &&\n \tgit add one &&\n-- \n1.7.2.3.557.gab647.dirty\n"},{"id":"155244","messageId":"AANLkTimYj3dW76QGdgx1F1PGxZ7_my9H=JV+FnB4aaVF@mail.gmail.com","threadId":"25321","inReplyTo":"20101031014654.GC29456@burratino","subject":"Re: [PATCH en/cascade-tests] tests: add missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-11-05T04:57:08Z","receivedAt":"2010-11-05T04:57:08Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Hi,\n\nOn Sat, Oct 30, 2010 at 7:46 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Breaks in a test assertion's && chain can potentially hide\n> failures from earlier commands in the chain.\n>\n> Commands intended to fail should be marked with !, test_must_fail, or\n> test_might_fail.  The examples in this patch do not require that.\n>\n> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>\n> ---\n> Hi,\n>\n> Just found some time to work through reports from the && checker.\n> The examples below only add && to the end of lines in various tests.\n> Passes all tests there (though of course that does not mean much).\n>\n> Thoughts?\n\nI haven't had a chance to look at this in detail, but this is really\ncool.  Thanks for working on it.  (And sorry for disappearing for over\na month with some unfinished series; I'll try to update them this\nweekend.)\n\n\nElijah\n"},{"id":"155546","messageId":"7vr5eukuch.fsf@alter.siamese.dyndns.org","threadId":"25321","inReplyTo":"7vr5f73umz.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH en/cascade-tests] tests: add missing &&","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-11-09T22:25:34Z","receivedAt":"2010-11-09T22:25:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Looked up to but not including t5302 and all looked Ok.\n\nI looked at the rest and it looked fine.  Queued on top of en/and-cascade-tests\nand seems to merge to 'pu' without much conflicts.\n\nThanks.\n"},{"id":"155548","messageId":"7veiaukswn.fsf@alter.siamese.dyndns.org","threadId":"25321","inReplyTo":"20101031073350.GC11483@burratino","subject":"Re: [RFC/PATCH 02/10] test-lib: introduce test_line_count to measure files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-11-09T22:56:40Z","receivedAt":"2010-11-09T22:56:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> Introduce a test_line_count function to help. If used like\n>\n> \tgit ls-files -u B >output &&\n> \ttest_line_count -eq 3 output\n>\n> it will produce output like\n>\n> \ttest_line_count: line count for output !-eq 3\n> \t100644 b023018cabc396e7692c70bbf5784a93d3f738ab 2\thi.c\n> \t100644 45b983be36b73c0788dc9cbcb76cbb80fc7bb057 3\thi.c\n>\n> on failure.\n\nSounds like a sane thing to do.\n\nEspecially because you wrote the implementation without surrounding dq\npair, the callers can say \"test_line_count = $N $file\" instead of -eq and\nthings will not break.  Nice.\n"},{"id":"155549","messageId":"AANLkTi=NmzMpaEq+iCHdDQth9WdsweLeEbzJBkuP+hZZ@mail.gmail.com","threadId":"25321","inReplyTo":"20101031073350.GC11483@burratino","subject":"Re: [RFC/PATCH 02/10] test-lib: introduce test_line_count to measure files","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-11-09T23:09:41Z","receivedAt":"2010-11-09T23:09:41Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sun, Oct 31, 2010 at 08:33, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Some tests check their output with code like the following:\n>\n>        test \"$(git ls-files -u B | wc -l)\" -eq 3 || {\n>                echo \"BAD: should have left stages for B\"\n>                return 1\n>        }\n>\n> The verbose failure condition is used because test, unlike\n> diff, does not print any useful information about the\n> nature of the failure when it fails.\n>\n> Introduce a test_line_count function to help. If used like\n>\n>        git ls-files -u B >output &&\n>        test_line_count -eq 3 output\n\nIn an earlier thread I suggested an interface like:\n\n    test_line_count 3 \"git ls-files -u B\"\n\nBut I like yours much better. Ack.\n"},{"id":"156061","messageId":"7vd3q3g7h9.fsf@alter.siamese.dyndns.org","threadId":"25321","inReplyTo":"20101031074030.GJ11483@burratino","subject":"Re: [PATCH 09/10] t3404 (rebase -i): introduce helper to check position of HEAD","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-11-17T17:55:46Z","receivedAt":"2010-11-17T17:55:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> The same code to check the position of HEAD is used by several\n> tests in this script.  Factor it out as a function and simplify it.\n\nThat rationale makes sense, but why use describe for it, especially if the\nhelper is called \"cmp-rev\"?  The tests here are not about catching\nbreakages in describe.\n\nWhen we later want to move this helper to test-lib.sh, some potential\ncallers may find it inconvenient that use of describe robs the ability to\ntell annotated tags from bare commits.\n\n> +test_cmp_rev () {\n> +\tgit describe --always --tags \"$1\" >expect.rev &&\n> +\tgit describe --always --tags \"$2\" >actual.rev &&\n> +\ttest_cmp expect.rev actual.rev\n> +}\n"},{"id":"156069","messageId":"7v62vvee97.fsf@alter.siamese.dyndns.org","threadId":"25321","inReplyTo":"20101031073951.GI11483@burratino","subject":"Re: [PATCH 08/10] t3404 (rebase -i): move comment to description","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-11-17T23:12:20Z","receivedAt":"2010-11-17T23:12:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> Add a comment describing the setup in t3404 to its --help output.\n\nYou learn new things every day---I didn't know our tests supported the -h\noption ;-)\n\nYeah, yeah, e1970ce ([PATCH 1/2] Test framework take two., 2005-05-13) was\nmine, but I forgot all about it.\n"}]}