{"thread":{"id":"25316","subject":"[PATCHv5 00/16] Add missing &&'s in the testsuite","startedAt":"2010-10-03T05:10:28Z","lastAt":"2010-10-04T02:52:35Z","messageCount":32,"participants":["Elijah Newren","Jonathan Nieder","Junio C Hamano","Ævar Arnfjörð Bjarmason"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"152310","messageId":"1286082644-31595-1-git-send-email-newren@gmail.com","threadId":"25316","inReplyTo":null,"subject":"[PATCHv5 00/16] Add missing &&'s in the testsuite","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T05:10:28Z","receivedAt":"2010-10-03T05:10:28Z","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.  And for being patient with my lack of\nknowledge on some of this stuff.\n\nChanges since v4:\n  * Included Ævar's patch to make test_expect_code a test command\n    (which appears to not be in pu yet); this allowed cleaning up my\n    t4017 patch nicely.  Cleaned up t4017.\n  * Lots of fixes suggested by Junio, Jonathan, and Ævar\n  * Changed the last patch to introduce a new portable_unset() helper\n    function and use it to enable proper && chaining in combination\n    with unsetting variables.\n  * Reverted t3600 to originally submitted patch, due to issues\n    Jonathan pointed out in the version in v3/v4.\n  * Added some acks from Jonathan that I assume were implied by his\n    reviews.  Hope I didn't add ones I shouldn't or miss ones I should\n    have added.\n\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                                    |   16 +++---\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                    |    6 +-\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                      |   71 ++++++++-------------------\n t/t4019-diff-wserror.sh                     |   52 ++++++++++----------\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                            |    6 +-\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                               |   44 ++++++++++-------\n 100 files changed, 418 insertions(+), 409 deletions(-)\n\n-- \n1.7.3.1.66.gab790\n"},{"id":"152312","messageId":"1286082644-31595-2-git-send-email-newren@gmail.com","threadId":"25316","inReplyTo":"1286082644-31595-1-git-send-email-newren@gmail.com","subject":"[PATCHv5 01/16] test-lib: make test_expect_code a test command","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T05:10:29Z","receivedAt":"2010-10-03T05:10:29Z","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.\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 no the TODO test I\nadded in v1.7.3-rc0~2^2~3.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\nNo changes from Ævar's submission; I just pulled it into this patch\nseries since it's not in pu yet and I wanted to depend on it.\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..c216e8c 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> <git-command>\n+\n+   Run a git command and ensure that it exits with the given exit\n+   code. 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":"152311","messageId":"1286082644-31595-3-git-send-email-newren@gmail.com","threadId":"25316","inReplyTo":"1286082644-31595-1-git-send-email-newren@gmail.com","subject":"[PATCHv5 02/16] t3020 (ls-files-error-unmatch): remove stray '1' from end of file","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T05:10:30Z","receivedAt":"2010-10-03T05:10:30Z","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>\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":"152313","messageId":"1286082644-31595-4-git-send-email-newren@gmail.com","threadId":"25316","inReplyTo":"1286082644-31595-1-git-send-email-newren@gmail.com","subject":"[PATCHv5 03/16] t4017 (diff-retval): replace manual exit code check with test_expect_code","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T05:10:31Z","receivedAt":"2010-10-03T05:10:31Z","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 t/t4017-diff-retval.sh |   71 ++++++++++++++---------------------------------\n 1 files changed, 21 insertions(+), 50 deletions(-)\n\ndiff --git a/t/t4017-diff-retval.sh b/t/t4017-diff-retval.sh\nindex 6158985..fc44850 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@@ -145,20 +122,14 @@ test_expect_success 'check honors conflict marker length' '\n \tgit reset --hard &&\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+\tgit diff --check a\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":"152314","messageId":"1286082644-31595-5-git-send-email-newren@gmail.com","threadId":"25316","inReplyTo":"1286082644-31595-1-git-send-email-newren@gmail.com","subject":"[PATCHv5 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-03T05:10:32Z","receivedAt":"2010-10-03T05:10:32Z","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>\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":"152316","messageId":"1286082644-31595-6-git-send-email-newren@gmail.com","threadId":"25316","inReplyTo":"1286082644-31595-1-git-send-email-newren@gmail.com","subject":"[PATCHv5 05/16] t4002 (diff-basic): use test_might_fail for commands that might fail","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T05:10:33Z","receivedAt":"2010-10-03T05:10:33Z","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>\nAcked-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":"152315","messageId":"1286082644-31595-7-git-send-email-newren@gmail.com","threadId":"25316","inReplyTo":"1286082644-31595-1-git-send-email-newren@gmail.com","subject":"[PATCHv5 06/16] t4202 (log): Replace '<git-command> || :' with test_might_fail","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T05:10:34Z","receivedAt":"2010-10-03T05:10:34Z","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>\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":"152321","messageId":"1286082644-31595-8-git-send-email-newren@gmail.com","threadId":"25316","inReplyTo":"1286082644-31595-1-git-send-email-newren@gmail.com","subject":"[PATCHv5 07/16] t3600 (rm): add lots of missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T05:10:35Z","receivedAt":"2010-10-03T05:10:35Z","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---\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":"152320","messageId":"1286082644-31595-9-git-send-email-newren@gmail.com","threadId":"25316","inReplyTo":"1286082644-31595-1-git-send-email-newren@gmail.com","subject":"[PATCHv5 08/16] t4019 (diff-wserror): add lots of missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T05:10:36Z","receivedAt":"2010-10-03T05:10:36Z","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>\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n t/t4019-diff-wserror.sh |   52 +++++++++++++++++++++++-----------------------\n 1 files changed, 26 insertions(+), 26 deletions(-)\n\ndiff --git a/t/t4019-diff-wserror.sh b/t/t4019-diff-wserror.sh\nindex f6d1f1e..36f06c7 100755\n--- a/t/t4019-diff-wserror.sh\n+++ b/t/t4019-diff-wserror.sh\n@@ -40,7 +40,7 @@ prepare_output () {\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 +52,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 +65,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 +79,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 +93,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 +107,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 +121,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 +135,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 +149,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 +179,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":"152324","messageId":"1286082644-31595-10-git-send-email-newren@gmail.com","threadId":"25316","inReplyTo":"1286082644-31595-1-git-send-email-newren@gmail.com","subject":"[PATCHv5 09/16] t4026 (color): remove unneeded and unchained command","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T05:10:37Z","receivedAt":"2010-10-03T05:10:37Z","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>\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":"152317","messageId":"1286082644-31595-11-git-send-email-newren@gmail.com","threadId":"25316","inReplyTo":"1286082644-31595-1-git-send-email-newren@gmail.com","subject":"[PATCHv5 10/16] t5602 (clone-remote-exec): add missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T05:10:38Z","receivedAt":"2010-10-03T05:10:38Z","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>\nAcked-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":"152318","messageId":"1286082644-31595-12-git-send-email-newren@gmail.com","threadId":"25316","inReplyTo":"1286082644-31595-1-git-send-email-newren@gmail.com","subject":"[PATCHv5 11/16] t6016 (rev-list-graph-simplify-history): add missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T05:10:39Z","receivedAt":"2010-10-03T05:10:39Z","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>\nAcked-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":"152319","messageId":"1286082644-31595-13-git-send-email-newren@gmail.com","threadId":"25316","inReplyTo":"1286082644-31595-1-git-send-email-newren@gmail.com","subject":"[PATCHv5 12/16] t7001 (mv): add missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T05:10:40Z","receivedAt":"2010-10-03T05:10:40Z","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>\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":"152323","messageId":"1286082644-31595-14-git-send-email-newren@gmail.com","threadId":"25316","inReplyTo":"1286082644-31595-1-git-send-email-newren@gmail.com","subject":"[PATCHv5 13/16] t7601 (merge-pull-config): add missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T05:10:41Z","receivedAt":"2010-10-03T05:10:41Z","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>\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":"152322","messageId":"1286082644-31595-15-git-send-email-newren@gmail.com","threadId":"25316","inReplyTo":"1286082644-31595-1-git-send-email-newren@gmail.com","subject":"[PATCHv5 14/16] t7800 (difftool): add missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T05:10:42Z","receivedAt":"2010-10-03T05:10:42Z","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>\nAcked-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":"152326","messageId":"1286082644-31595-16-git-send-email-newren@gmail.com","threadId":"25316","inReplyTo":"1286082644-31595-1-git-send-email-newren@gmail.com","subject":"[PATCHv5 15/16] Add missing &&'s throughout the testsuite","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T05:10:43Z","receivedAt":"2010-10-03T05:10:43Z","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 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                    |    6 ++--\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                            |    6 ++--\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, 188 insertions(+), 191 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..e3391b7 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,8 @@ say \"auto bare gitdir\"\n \n # DESTROYYYYY!!!!!\n test_expect_success 'setup' '\n-\trm -rf /refs /objects /info /hooks\n-\trm /*\n+\trm -rf /refs /objects /info /hooks &&\n+\trm /* &&\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..b224d26 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,8 +93,8 @@ 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+\t! grep '/git-upload-pack' <\"$HTTPD_ROOT_PATH\"/access.log >act &&\n+\t>exp &&\n \ttest_cmp exp act\n '\n \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..a37797d 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 &&\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":"152325","messageId":"1286082644-31595-17-git-send-email-newren@gmail.com","threadId":"25316","inReplyTo":"1286082644-31595-1-git-send-email-newren@gmail.com","subject":"[PATCHv5 16/16] Introduce portable_unset and use it to ensure proper && chaining","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T05:10:44Z","receivedAt":"2010-10-03T05:10:44Z","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 t/t0001-init.sh   |   28 ++++++++++++++--------------\n t/t7006-pager.sh  |   10 +++++-----\n t/t7502-commit.sh |    4 ++--\n t/test-lib.sh     |    4 ++++\n 4 files changed, 25 insertions(+), 21 deletions(-)\n\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..1f8d488 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -268,6 +268,10 @@ remove_cr () {\n \ttr '\\015' Q | sed -e 's/Q$//'\n }\n \n+portable_unset () {\n+\tunset $* || true\n+}\n+\n test_tick () {\n \tif test -z \"${test_tick+set}\"\n \tthen\n-- \n1.7.3.1.66.gab790\n"},{"id":"152355","messageId":"20101003134757.GA17084@burratino","threadId":"25316","inReplyTo":"1286082644-31595-4-git-send-email-newren@gmail.com","subject":"Re: [PATCHv5 03/16] t4017 (diff-retval): replace manual exit code check with test_expect_code","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-03T13:47:58Z","receivedAt":"2010-10-03T13:47:58Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Elijah Newren wrote:\n\n> Signed-off-by: Elijah Newren <newren@gmail.com>\n\nFor the confused: this patch takes advantage of patch 1 to clarify\nthe t4017 (diff exit code) tests.  No functional change should be\ninvolved, except better error messages when tests fail with -v.\n\n> --- a/t/t4017-diff-retval.sh\n> +++ b/t/t4017-diff-retval.sh\n[...]\n> @@ -145,20 +122,14 @@ test_expect_success 'check honors conflict marker length' '\n>  \tgit reset --hard &&\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> +\tgit diff --check a\n> +\ttest_expect_code 2 git diff --check b &&\n\nMissing &&?\n\nWith that exception,\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n"},{"id":"152357","messageId":"20101003141339.GB17084@burratino","threadId":"25316","inReplyTo":"1286082644-31595-2-git-send-email-newren@gmail.com","subject":"Re: [PATCHv5 01/16] test-lib: make test_expect_code a test command","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-03T14:13:39Z","receivedAt":"2010-10-03T14:13:39Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Elijah Newren wrote:\n\n> --- a/t/README\n> +++ b/t/README\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> <git-command>\n> +\n> +   Run a git command and ensure that it exits with the given exit\n> +   code. 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\nSide note: this helper should be safe to use even for non-git\ncommands.  \"Huh?\" you might ask. \"But test_must_fail and\ntest_might_fail...\"  Well, the distinction is this: test_must_fail and\ntest_might_fail rely on details of git's funny exit code conventions\n--- e.g., that 130 is not a controlled failure and 129 is one ---\nwhile test_expect_code has simpler, more generally valid semantics.\n\nBut maybe in practice this helper would only be used for git commands\nanyway.\n\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> +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\nIs $SHELL_PATH allowed to contain a shell metacharacter? (just\ncurious).\n\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\nQuoting issues?  I suspect the first $TEST_DIRECTORY here would\nbe twice expanded and the second would be once expanded before\nfailing-cleanup.sh is written.\n\nOn the other hand, a $TEST_DIRECTORY with backslashes in it is\nasking for trouble for other reasons already.\n\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\nThis changes the semantics of the test: before, it checked that\nthe exit code was propagated out in these failure cases, but now\nit just checks that the test fails.\n\nThe new semantics are probably more appropriate --- who relies on\nthe exact exit status from a test script, anyway?\n\n> --- a/t/t1504-ceiling-dirs.sh\n> +++ b/t/t1504-ceiling-dirs.sh\n[...]\n> --- a/t/t6020-merge-df.sh\n> +++ b/t/t6020-merge-df.sh\n[...]\n\nNice. :)\n\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\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\nThis makes the tests noisier on success.  I have no strong feelings\neither way about that, but it's probably worth mentioning in the commit\nmessage.\n\nAnyway, for what it's worth,\nAcked-by: Jonathan Nieder <jrnieder@gmail.com>\n\nThanks.\n"},{"id":"152358","messageId":"20101003142855.GC17084@burratino","threadId":"25316","inReplyTo":"1286082644-31595-8-git-send-email-newren@gmail.com","subject":"Re: [PATCHv5 07/16] t3600 (rm): add lots of missing &&","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-03T14:28:55Z","receivedAt":"2010-10-03T14:28:55Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Elijah Newren wrote:\n\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 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\nWhy not\n\n\t-\techo content > foo\n\t-\tgit add foo\n\t-\tgit commit -m foo\n\t+\techo content > foo &&\n\t+\tgit add foo &&\n\t+\tgit commit --allow-empty -m foo &&\n\n?\n\nLikewise for the next case.  Though in the long run, a helper function\nto prepare the HEAD, index, and work tree would probably be the way to\ngo for this test.\n\nWith the change below (or whatever else is deemed appropriate),\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n\nSorry to draw this out so.\n---\ndiff --git a/t/t3600-rm.sh b/t/t3600-rm.sh\nindex 9660ae0..53add72 100755\n--- a/t/t3600-rm.sh\n+++ b/t/t3600-rm.sh\n@@ -46,13 +46,15 @@ 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+     git commit --allow-empty -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-     git checkout HEAD -- foo &&\n+     echo content > foo &&\n+     git add foo &&\n+     git commit --allow-empty -m foo &&\n      echo \"other content\" > foo &&\n      git add foo &&\n      echo \"yet another content\" > foo &&\n@@ -61,7 +63,9 @@ test_expect_success \\\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 content > foo &&\n+     git add foo &&\n+     git commit --allow-empty -m foo &&\n      echo \"other content\" > foo &&\n      git add foo &&\n      echo \"yet another content\" > foo &&\n-- \n"},{"id":"152359","messageId":"20101003143211.GD17084@burratino","threadId":"25316","inReplyTo":"1286082644-31595-9-git-send-email-newren@gmail.com","subject":"Re: [PATCHv5 08/16] t4019 (diff-wserror): add lots of missing &&","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-03T14:32:11Z","receivedAt":"2010-10-03T14:32:11Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Elijah Newren wrote:\n\n> --- a/t/t4019-diff-wserror.sh\n> +++ b/t/t4019-diff-wserror.sh\n> @@ -40,7 +40,7 @@ prepare_output () {\n>  \n>  test_expect_success default '\n>  \n> -\tprepare_output\n> +\tprepare_output &&\n\nAs I asked before:\n\nThe exit status from prepare_output is the exit status from its last\ncommand, which is \"grep -v <something blue>\".  It seems that never\nfails in these test cases, but should we be relying on that?\n\nSo I would be more comfortable with the following on top.\n\n---\ndiff --git a/t/t4019-diff-wserror.sh b/t/t4019-diff-wserror.sh\nindex 36f06c7..afd74c8 100755\n--- a/t/t4019-diff-wserror.sh\n+++ b/t/t4019-diff-wserror.sh\n@@ -36,6 +36,7 @@ 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"},{"id":"152360","messageId":"20101003144650.GE17084@burratino","threadId":"25316","inReplyTo":"1286082644-31595-16-git-send-email-newren@gmail.com","subject":"Re: [PATCHv5 15/16] Add missing &&'s throughout the testsuite","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-03T14:46:50Z","receivedAt":"2010-10-03T14:46:50Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Elijah Newren 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> -\trm -rf /refs /objects /info /hooks\n> -\trm /*\n> +\trm -rf /refs /objects /info /hooks &&\n> +\trm /* &&\n\nI'm worried that this would fail:\n\n\t$ mkdir foo\n\t$ cd foo\n\t$ >bar\n\t$ mkdir baz\n\t$ rm *\n\trm: cannot remove `baz': Is a directory\n\t$ echo $?\n\t1\n\n[...]\n> --- a/t/t5550-http-fetch.sh\n> +++ b/t/t5550-http-fetch.sh\n> @@ -93,8 +93,8 @@ 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> +\t! grep '/git-upload-pack' <\"$HTTPD_ROOT_PATH\"/access.log >act &&\n> +\t>exp &&\n>  \ttest_cmp exp act\n\nOr better:\n\n\ttest_expect_success 'did not use upload-pack service' '\n\t\t! grep '/git-upload-pack' <\"$HTTPD_ROOT_PATH\"/access.log\n\t'\n\nThis way, (like before) one would get to see the git-upload-pack lines\nwhen the test fails while running with -v.\n\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 &&\n\nMissing SYMLINKS prereq?\n"},{"id":"152361","messageId":"20101003145122.GF17084@burratino","threadId":"25316","inReplyTo":"1286082644-31595-17-git-send-email-newren@gmail.com","subject":"Re: [PATCHv5 16/16] Introduce portable_unset and use it to ensure proper && chaining","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-03T14:51:22Z","receivedAt":"2010-10-03T14:51:22Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Elijah Newren wrote:\n\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -268,6 +268,10 @@ remove_cr () {\n>  \ttr '\\015' Q | sed -e 's/Q$//'\n>  }\n>  \n> +portable_unset () {\n> +\tunset $* || true\n> +}\n\nI think this should read\n\n\tportable_unset () {\n\t\tunset \"$@\"\n\t\treturn 0\n\t}\n\n(or || true).  That is, if I try\n\n\tportable_unset \"foo bar\"\n\nthen on platforms where an envvar named \"foo bar\" is allowed,\nthis should unset it, no?\n\nAlso, maybe a comment could guide people in using this:\n\n\t# In some bourne shell implementations, the \"unset\" builtin\n\t# returns nonzero status when a variable to be unset was not\n\t# set in the first place.\n\t#\n\t# Use portable_unset when that should not be considered an\n\t# error.\n\nAn update to t/README would be nice, too. :)\n"},{"id":"152363","messageId":"20101003145440.GG17084@burratino","threadId":"25316","inReplyTo":"1286082644-31595-1-git-send-email-newren@gmail.com","subject":"Re: [PATCHv5 00/16] Add missing &&'s in the testsuite","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-03T14:54:40Z","receivedAt":"2010-10-03T14:54:40Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nElijah Newren wrote:\n\n> This patch series fixes many of the missing &&s in the testsuite.\n\nExcept as pointed out in my replies to 1, 3, 7, 8, 15, 16,\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n\nThanks.  I wish we could automatically detect these broken &&\nchains, to make this less of an uphill battle.\n"},{"id":"152377","messageId":"AANLkTik-ztiY6o=S09UyJ1zg4xxtnBXaXaK1yuLZQ0-+@mail.gmail.com","threadId":"25316","inReplyTo":"20101003141339.GB17084@burratino","subject":"Re: [PATCHv5 01/16] test-lib: make test_expect_code a test command","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T19:29:40Z","receivedAt":"2010-10-03T19:29:40Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"I'll have to let Ævar respond to most of these, but two quick items...\n\nOn Sun, Oct 3, 2010 at 8:13 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Elijah Newren wrote:\n>\n>> --- a/t/README\n>> +++ b/t/README\n>> @@ -482,6 +475,15 @@ 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>> +\n>> +   Run a git command and ensure that it exits with the given exit\n>> +   code. For example:\n>> +\n>> +     test_expect_success 'Merge with d/f conflicts' '\n>> +             test_expect_code 1 git merge \"merge msg\" B master\n>> +     '\n>\n> Side note: this helper should be safe to use even for non-git\n> commands.  \"Huh?\" you might ask. \"But test_must_fail and\n> test_might_fail...\"  Well, the distinction is this: test_must_fail and\n> test_might_fail rely on details of git's funny exit code conventions\n> --- e.g., that 130 is not a controlled failure and 129 is one ---\n> while test_expect_code has simpler, more generally valid semantics.\n>\n> But maybe in practice this helper would only be used for git commands\n> anyway.\n\nPerhaps, but I agree that it at least makes sense to be used by other\ncommands, so I'll change the documentation here to replace \"git\ncommands\" with just \"commands\".\n\n[...]\n\n>> +test_expect_code () {\n>> +     want_code=$1\n>> +     shift\n>> +     \"$@\"\n>> +     exit_code=$?\n>> +     if test $exit_code = $want_code\n>> +     then\n>> +             echo >&2 \"test_expect_code: command exited with $exit_code: $*\"\n>> +             return 0\n>\n> This makes the tests noisier on success.  I have no strong feelings\n> either way about that, but it's probably worth mentioning in the commit\n> message.\n\nI added a brief note in the commit mesage, which I'll resend with the\nfixed-up series in a minute.\n"},{"id":"152378","messageId":"AANLkTik1D3m-n1LZqq0cs1j7TdTVsi9LfiwcrWSHinPJ@mail.gmail.com","threadId":"25316","inReplyTo":"20101003134757.GA17084@burratino","subject":"Re: [PATCHv5 03/16] t4017 (diff-retval): replace manual exit code check with test_expect_code","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T19:33:04Z","receivedAt":"2010-10-03T19:33:04Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Sun, Oct 3, 2010 at 7:47 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>> @@ -145,20 +122,14 @@ test_expect_success 'check honors conflict marker length' '\n>>       git reset --hard &&\n>>       echo \">>>>>>> boo\" >>b &&\n>>       echo \"======\" >>a &&\n>> -     git diff --check a &&\n>> -     (\n>> -             git diff --check b\n>> -             test $? = 2\n>> -     ) &&\n>> +     git diff --check a\n>> +     test_expect_code 2 git diff --check b &&\n>\n> Missing &&?\n\nIndeed -- that's pretty embarrassing, considering the topic of the\nseries.  :-/  Good catch.\n\n> With that exception,\n> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n\nThanks.\n"},{"id":"152379","messageId":"AANLkTinYkq+e5gPxRMSNHqk9zqyku+NPpUYXJMXL0R_0@mail.gmail.com","threadId":"25316","inReplyTo":"20101003142855.GC17084@burratino","subject":"Re: [PATCHv5 07/16] t3600 (rm): add lots of missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T19:37:11Z","receivedAt":"2010-10-03T19:37:11Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Sun, Oct 3, 2010 at 8:28 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\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 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>\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\nWhat advantage does using these three commands have over 'git checkout\nHEAD -- foo'?  Perhaps I'm missing something, but I don't see it.\nIt's three commands to one, and the tests don't depend on foo starting\nwith contents of 'content'; just that foo matches HEAD to start.\n\nHowever, I'm fine with this alternative as well, if others prefer it.\n"},{"id":"152380","messageId":"AANLkTin3vtqGJDC4hrmKpFZ6e+Sw5OP15QPjO16cxgkx@mail.gmail.com","threadId":"25316","inReplyTo":"20101003144650.GE17084@burratino","subject":"Re: [PATCHv5 15/16] Add missing &&'s throughout the testsuite","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T19:39:45Z","receivedAt":"2010-10-03T19:39:45Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"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\nHow about replacing the two rm commands with a simple 'rm -rf /*'?\n\n>        test_expect_success 'did not use upload-pack service' '\n>                ! grep '/git-upload-pack' <\"$HTTPD_ROOT_PATH\"/access.log\n>        '\n>\n> This way, (like before) one would get to see the git-upload-pack lines\n> when the test fails while running with -v.\n\nMake sense.\n\n>> -     ln -s docs/manual.txt src/part4.c\n>> +     ln -s docs/manual.txt src/part4.c &&\n>>       git clean &&\n>>       test -f Makefile &&\n>>       test -f README &&\n>\n> Missing SYMLINKS prereq?\n\nIndeed.\n"},{"id":"152381","messageId":"AANLkTi=9-rVwPN0aMg5cdhtV9yYnXCgPV4deAe3ke3At@mail.gmail.com","threadId":"25316","inReplyTo":"20101003145122.GF17084@burratino","subject":"Re: [PATCHv5 16/16] Introduce portable_unset and use it to ensure proper && chaining","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T19:41:33Z","receivedAt":"2010-10-03T19:41:33Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Sun, Oct 3, 2010 at 8:51 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> I think this should read\n>\n>        portable_unset () {\n>                unset \"$@\"\n>                return 0\n>        }\n>\n> (or || true).  That is, if I try\n>\n>        portable_unset \"foo bar\"\n>\n> then on platforms where an envvar named \"foo bar\" is allowed,\n> this should unset it, no?\n>\n> Also, maybe a comment could guide people in using this:\n>\n>        # In some bourne shell implementations, the \"unset\" builtin\n>        # returns nonzero status when a variable to be unset was not\n>        # set in the first place.\n>        #\n>        # Use portable_unset when that should not be considered an\n>        # error.\n>\n> An update to t/README would be nice, too. :)\n\nYes, all the above sounds good, as does your other changes on this\nseries that I didn't yet comment on; I made the relevant changes for\nall these comments.  Thanks!\n"},{"id":"152436","messageId":"7v62xietqc.fsf@alter.siamese.dyndns.org","threadId":"25316","inReplyTo":"AANLkTin3vtqGJDC4hrmKpFZ6e+Sw5OP15QPjO16cxgkx@mail.gmail.com","subject":"Re: [PATCHv5 15/16] Add missing &&'s throughout the testsuite","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-10-03T23:34:19Z","receivedAt":"2010-10-03T23:34:19Z","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> 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\nHow would \"rm -rf /*\" that will remove /bin/sh and /usr/bin/git among\nother things would possibly help?  Isn't this test about having a minimum\nchroot with /bin, /usr populated with minimum git (and presumably shell\ntools) and for whatever sick reason have a bare git repository at /?\n"},{"id":"152434","messageId":"7vzkuudf5p.fsf@alter.siamese.dyndns.org","threadId":"25316","inReplyTo":"20101003145122.GF17084@burratino","subject":"Re: [PATCHv5 16/16] Introduce portable_unset and use it to ensure proper && chaining","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-10-03T23:34:26Z","receivedAt":"2010-10-03T23:34:26Z","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> Elijah Newren wrote:\n>\n>> --- a/t/test-lib.sh\n>> +++ b/t/test-lib.sh\n>> @@ -268,6 +268,10 @@ remove_cr () {\n>>  \ttr '\\015' Q | sed -e 's/Q$//'\n>>  }\n>>  \n>> +portable_unset () {\n>> +\tunset $* || true\n>> +}\n>\n> I think this should read\n>\n> \tportable_unset () {\n> \t\tunset \"$@\"\n> \t\treturn 0\n> \t}\n>\n> (or || true).  That is, if I try\n>\n> \tportable_unset \"foo bar\"\n>\n> then on platforms where an envvar named \"foo bar\" is allowed,\n> this should unset it, no?\n\nYes, or closer to Elijah's original:\n\n\tunset \"$@\" || true\n\nI do not think calling this \"portable_\" makes much sense, though.  Maybe\ndepending on the exit status of \"unset\" may be unportable, but the wrapper\ndoes not make unset portable.  It just picks one behaviour we happen to\nlike among the possible two (one being \"unset always succeeds\" vs the\nother being \"unset errors out if you feed an unset variable\").\n\nI have no objection against calling it \"sane_unset\", though.  It makes it\ncrystal clear that the semantics wrapper implements is what we picked\nbecause we like (i.e. deem the sanest among alternatives).\n"},{"id":"152442","messageId":"AANLkTinYGbAE6ymp-9nFN-OXe8-iL9=9Jkf7noDGQNg3@mail.gmail.com","threadId":"25316","inReplyTo":"20101003143211.GD17084@burratino","subject":"Re: [PATCHv5 08/16] t4019 (diff-wserror): add lots of missing &&","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-10-04T02:52:35Z","receivedAt":"2010-10-04T02:52:35Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sun, Oct 3, 2010 at 14:32, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Elijah Newren wrote:\n>\n>> --- a/t/t4019-diff-wserror.sh\n>> +++ b/t/t4019-diff-wserror.sh\n>> @@ -40,7 +40,7 @@ prepare_output () {\n>>\n>>  test_expect_success default '\n>>\n>> -     prepare_output\n>> +     prepare_output &&\n>\n> As I asked before:\n>\n> The exit status from prepare_output is the exit status from its last\n> command, which is \"grep -v <something blue>\".  It seems that never\n> fails in these test cases, but should we be relying on that?\n>\n> So I would be more comfortable with the following on top.\n>\n> ---\n> diff --git a/t/t4019-diff-wserror.sh b/t/t4019-diff-wserror.sh\n> index 36f06c7..afd74c8 100755\n> --- a/t/t4019-diff-wserror.sh\n> +++ b/t/t4019-diff-wserror.sh\n> @@ -36,6 +36,7 @@ prepare_output () {\n>        git diff --color >output\n>        $grep_a \"$blue_grep\" output >error\n>        $grep_a -v \"$blue_grep\" output >normal\n> +       return 0\n>  }\n>\n>  test_expect_success default '\n>\n\nIf we want to rely on that this would make more sense probably:\n\n     prepare_output () {\n    -       git diff --color >output\n    -       $grep_a \"$blue_grep\" output >error\n    +       git diff --color >output &&\n    +       $grep_a \"$blue_grep\" output >error &&\n            $grep_a -v \"$blue_grep\" output >normal\n     }\n\nBut I don't know whether that makes sense.\n"}]}