{"thread":{"id":"25253","subject":"[PATCHv4 04/15] t4002 (diff-basic): use test_might_fail for commands that might fail","startedAt":"2010-09-26T23:14:24Z","lastAt":"2010-10-03T03:08:58Z","messageCount":51,"participants":["Elijah Newren","Jonathan Nieder","Junio C Hamano","Ævar Arnfjörð Bjarmason","Sverre Rabbelier"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"151760","messageId":"1285542879-16381-1-git-send-email-newren@gmail.com","threadId":"25253","inReplyTo":null,"subject":"[PATCHv4 00/15] Add missing &&'s in the testsuite","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-09-26T23:14:24Z","receivedAt":"2010-09-26T23:14:24Z","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.  I'm\ncertain there are still others I have missed.\n\nChanges since v3:\n  * Dropped patch 11; Christian has submitted a more thorough fix that\n    includes my patch and more.\n  * Fixed issue in patch 15 of previous series (now patch 14) noted by Ævar.\n  * Fixed subject line for patch 8, as noted by Jeff.\n  * Added acks from Ævar Arnfjörð Bjarmason and Jeff King\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  Replace \"unset VAR\" with \"unset VAR;\" in testsuite as per t/README\n\n t/t0001-init.sh                             |   30 ++++++++--------\n t/t0003-attributes.sh                       |   41 ++++++++++-----------\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/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                      |   30 +++++----------\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                |   14 ++++----\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  |   24 +++---------\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/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                         |   11 +++---\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 94 files changed, 302 insertions(+), 332 deletions(-)\n\n-- \n1.7.3.95.g14291\n"},{"id":"151759","messageId":"1285542879-16381-2-git-send-email-newren@gmail.com","threadId":"25253","inReplyTo":"1285542879-16381-1-git-send-email-newren@gmail.com","subject":"[PATCHv4 01/15] t3020 (ls-files-error-unmatch): remove stray '1' from end of file","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-09-26T23:14:25Z","receivedAt":"2010-09-26T23:14:25Z","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.95.g14291\n"},{"id":"151761","messageId":"1285542879-16381-3-git-send-email-newren@gmail.com","threadId":"25253","inReplyTo":"1285542879-16381-1-git-send-email-newren@gmail.com","subject":"[PATCHv4 02/15] t4017 (diff-retval): replace manual exit code check with test_expect_code","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-09-26T23:14:26Z","receivedAt":"2010-09-26T23:14:26Z","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/t4017-diff-retval.sh |   30 ++++++++++--------------------\n 1 files changed, 10 insertions(+), 20 deletions(-)\n\ndiff --git a/t/t4017-diff-retval.sh b/t/t4017-diff-retval.sh\nindex 6158985..6605e12 100755\n--- a/t/t4017-diff-retval.sh\n+++ b/t/t4017-diff-retval.sh\n@@ -28,37 +28,29 @@ test_expect_success 'git diff --quiet -w  HEAD^ HEAD' '\n \ttest_must_fail git diff --quiet -w HEAD^ HEAD\n '\n \n-test_expect_success 'git diff-tree HEAD^ HEAD' '\n+test_expect_code 1 'git diff-tree HEAD^ HEAD' '\n \tgit diff-tree --exit-code HEAD^ HEAD\n-\ttest $? = 1\n '\n-test_expect_success 'git diff-tree HEAD^ HEAD -- a' '\n+test_expect_code 0 '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+test_expect_code 1 'git diff-tree HEAD^ HEAD -- b' '\n \tgit diff-tree --exit-code HEAD^ HEAD -- b\n-\ttest $? = 1\n '\n-test_expect_success 'echo HEAD | git diff-tree --stdin' '\n+test_expect_code 1 'echo HEAD | git diff-tree --stdin' '\n \techo $(git rev-parse HEAD) | git diff-tree --exit-code --stdin\n-\ttest $? = 1\n '\n-test_expect_success 'git diff-tree HEAD HEAD' '\n+test_expect_code 0 '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+test_expect_code 0 'git diff-files' '\n \tgit diff-files --exit-code\n-\ttest $? = 0\n '\n-test_expect_success 'git diff-index --cached HEAD' '\n+test_expect_code 0 '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+test_expect_code 1 'git diff-index --cached HEAD^' '\n \tgit diff-index --exit-code --cached HEAD^\n-\ttest $? = 1\n '\n test_expect_success 'git diff-index --cached HEAD^' '\n \techo text >>b &&\n@@ -74,9 +66,8 @@ test_expect_success 'git diff-tree -Stext HEAD^ HEAD -- b' '\n \t\ttest $? = 1\n \t}\n '\n-test_expect_success 'git diff-tree -Snot-found HEAD^ HEAD -- b' '\n+test_expect_code 0 '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@@ -113,10 +104,9 @@ test_expect_success '--check --exit-code returns 3 for a dirty difference' '\n \n '\n \n-test_expect_success '--check with --no-pager returns 2 for dirty difference' '\n+test_expect_code 2 '--check with --no-pager returns 2 for dirty difference' '\n \n \tgit --no-pager diff --check\n-\ttest $? = 2\n \n '\n \n-- \n1.7.3.95.g14291\n"},{"id":"151758","messageId":"1285542879-16381-4-git-send-email-newren@gmail.com","threadId":"25253","inReplyTo":"1285542879-16381-1-git-send-email-newren@gmail.com","subject":"[PATCHv4 03/15] t100[12] (read-tree-m-2way, read_tree_m_u_2way): add missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-09-26T23:14:27Z","receivedAt":"2010-09-26T23:14:27Z","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..ce8112c 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_might_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_might_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_might_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_might_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..a9492e9 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_might_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_might_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.95.g14291\n"},{"id":"151756","messageId":"1285542879-16381-5-git-send-email-newren@gmail.com","threadId":"25253","inReplyTo":"1285542879-16381-1-git-send-email-newren@gmail.com","subject":"[PATCHv4 04/15] t4002 (diff-basic): use test_might_fail for commands that might fail","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-09-26T23:14:28Z","receivedAt":"2010-09-26T23:14:28Z","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.\n\nAcked-by: Ævar Arnfjörð Bjarmason <avarab@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..340aa7d 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_might_fail git update-index --refresh >/dev/null &&\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_might_fail git update-index --refresh >/dev/null &&\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_might_fail git update-index --refresh >/dev/null &&\n      git diff-files >.test-a &&\n      cmp_diff_files_output .test-a .test-recursive-AB'\n \n-- \n1.7.3.95.g14291\n"},{"id":"151770","messageId":"1285542879-16381-6-git-send-email-newren@gmail.com","threadId":"25253","inReplyTo":"1285542879-16381-1-git-send-email-newren@gmail.com","subject":"[PATCHv4 05/15] t4202 (log): Replace '<git-command> || :' with test_might_fail","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-09-26T23:14:29Z","receivedAt":"2010-09-26T23:14:29Z","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.95.g14291\n"},{"id":"151757","messageId":"1285542879-16381-7-git-send-email-newren@gmail.com","threadId":"25253","inReplyTo":"1285542879-16381-1-git-send-email-newren@gmail.com","subject":"[PATCHv4 06/15] t3600 (rm): add lots of missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-09-26T23:14:30Z","receivedAt":"2010-09-26T23:14:30Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Also delete unnecessary, failing code and add some test_when_finished\ncalls to make sure tests clean up after themselves.\n\nAcked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\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..b1f9abf 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+     test_when_finished \"git checkout HEAD -- 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+     echo \"other content\" > foo &&\n+     git add foo &&\n+     echo \"yet another content\" > foo &&\n+     test_when_finished \"git checkout HEAD -- 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+    '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.95.g14291\n"},{"id":"151762","messageId":"1285542879-16381-8-git-send-email-newren@gmail.com","threadId":"25253","inReplyTo":"1285542879-16381-1-git-send-email-newren@gmail.com","subject":"[PATCHv4 07/15] t4019 (diff-wserror): add lots of missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-09-26T23:14:31Z","receivedAt":"2010-09-26T23:14:31Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Also add a test_might_fail in front of the final git_config --unset\ncore.whitespace as that value may have already been unset previously.\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..2557ec7 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+\tgit 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+\tgit 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+\tgit 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+\tgit 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.95.g14291\n"},{"id":"151764","messageId":"1285542879-16381-9-git-send-email-newren@gmail.com","threadId":"25253","inReplyTo":"1285542879-16381-1-git-send-email-newren@gmail.com","subject":"[PATCHv4 08/15] t4026 (color): remove unneeded and unchained command","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-09-26T23:14:32Z","receivedAt":"2010-09-26T23:14:32Z","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.95.g14291\n"},{"id":"151763","messageId":"1285542879-16381-10-git-send-email-newren@gmail.com","threadId":"25253","inReplyTo":"1285542879-16381-1-git-send-email-newren@gmail.com","subject":"[PATCHv4 09/15] t5602 (clone-remote-exec): add missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-09-26T23:14:33Z","receivedAt":"2010-09-26T23:14:33Z","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.\n\nAcked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n t/t5602-clone-remote-exec.sh |   14 +++++++-------\n 1 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t5602-clone-remote-exec.sh b/t/t5602-clone-remote-exec.sh\nindex deffdae..6aa6e0d 100755\n--- a/t/t5602-clone-remote-exec.sh\n+++ b/t/t5602-clone-remote-exec.sh\n@@ -5,21 +5,21 @@ 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+\tGIT_SSH=./not_ssh test_must_fail git clone localhost:/path/to/repo junk &&\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+\tGIT_SSH=./not_ssh test_must_fail 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 \ttest_cmp expected not_ssh_output\n '\n \n-- \n1.7.3.95.g14291\n"},{"id":"151767","messageId":"1285542879-16381-11-git-send-email-newren@gmail.com","threadId":"25253","inReplyTo":"1285542879-16381-1-git-send-email-newren@gmail.com","subject":"[PATCHv4 10/15] t6016 (rev-list-graph-simplify-history): add missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-09-26T23:14:34Z","receivedAt":"2010-09-26T23:14:34Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Also removed several repeated tag and branch deletions, since the tags and\nbranches had already been deleted.\n\nAcked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n t/t6016-rev-list-graph-simplify-history.sh |   24 ++++++------------------\n 1 files changed, 6 insertions(+), 18 deletions(-)\n\ndiff --git a/t/t6016-rev-list-graph-simplify-history.sh b/t/t6016-rev-list-graph-simplify-history.sh\nindex 27fd52b..e640c41 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@@ -119,9 +119,9 @@ test_expect_success '--graph --simplify-by-decoration' '\n # Get rid of all decorations on branch B, and graph with it 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+\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 +143,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 +160,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 +175,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 +187,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.95.g14291\n"},{"id":"151766","messageId":"1285542879-16381-12-git-send-email-newren@gmail.com","threadId":"25253","inReplyTo":"1285542879-16381-1-git-send-email-newren@gmail.com","subject":"[PATCHv4 11/15] t7001 (mv): add missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-09-26T23:14:35Z","receivedAt":"2010-09-26T23:14:35Z","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.95.g14291\n"},{"id":"151768","messageId":"1285542879-16381-13-git-send-email-newren@gmail.com","threadId":"25253","inReplyTo":"1285542879-16381-1-git-send-email-newren@gmail.com","subject":"[PATCHv4 12/15] t7601 (merge-pull-config): add missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-09-26T23:14:36Z","receivedAt":"2010-09-26T23:14:36Z","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.95.g14291\n"},{"id":"151769","messageId":"1285542879-16381-14-git-send-email-newren@gmail.com","threadId":"25253","inReplyTo":"1285542879-16381-1-git-send-email-newren@gmail.com","subject":"[PATCHv4 13/15] t7800 (difftool): add missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-09-26T23:14:37Z","receivedAt":"2010-09-26T23:14:37Z","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>\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n t/t7800-difftool.sh |   11 +++++------\n 1 files changed, 5 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh\nindex 58dc6f6..ffb1960 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+\tgit config --unset diff.tool &&\n \tGIT_DIFF_TOOL=test-tool &&\n \texport GIT_DIFF_TOOL &&\n \n@@ -166,7 +166,6 @@ 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 \tgit config mergetool.prompt false &&\n \n \tdiff=$(git difftool branch) &&\n@@ -211,7 +210,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 +253,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.95.g14291\n"},{"id":"151771","messageId":"1285542879-16381-15-git-send-email-newren@gmail.com","threadId":"25253","inReplyTo":"1285542879-16381-1-git-send-email-newren@gmail.com","subject":"[PATCHv4 14/15] Add missing &&'s throughout the testsuite","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-09-26T23:14:38Z","receivedAt":"2010-09-26T23:14:38Z","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                       |   41 +++++++++++++--------------\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, 187 insertions(+), 188 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 de38c7f..ddd1c23 100755\n--- a/t/t0003-attributes.sh\n+++ b/t/t0003-attributes.sh\n@@ -19,24 +19,23 @@ 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-\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 '\n \n test_expect_success 'attribute test' '\n@@ -73,7 +72,7 @@ offon: test: set\n no: test: unspecified\n a/b/d/no: test: a/b/d/*\n a/b/d/yes: test: unspecified\n-EOF\n+EOF &&\n \n \tsed -e \"s/:.*//\" < expect | git check-attr --stdin test > actual &&\n \ttest_cmp expect actual\n@@ -96,7 +95,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@@ -110,7 +109,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..fe5f936 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+\tgit 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+\tgit 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+\tgit 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 a283dca..d42b8ab 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..3d0384d 100755\n--- a/t/t4119-apply-config.sh\n+++ b/t/t4119-apply-config.sh\n@@ -73,7 +73,7 @@ D=`pwd`\n test_expect_success 'apply --whitespace=strip in subdir' '\n \n \tcd \"$D\" &&\n-\tgit config --unset-all apply.whitespace\n+\tgit config --unset-all apply.whitespace &&\n \trm -f sub/file1 &&\n \tcp saved sub/file1 &&\n \tgit update-index --refresh &&\ndiff --git a/t/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..dc0021b 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+\tgrep '/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..ddabf4f 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+  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+EOF &&\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.95.g14291\n"},{"id":"151765","messageId":"1285542879-16381-16-git-send-email-newren@gmail.com","threadId":"25253","inReplyTo":"1285542879-16381-1-git-send-email-newren@gmail.com","subject":"[PATCHv4 15/15] Replace \"unset VAR\" with \"unset VAR;\" in testsuite as per t/README","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-09-26T23:14:39Z","receivedAt":"2010-09-26T23:14:39Z","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/t0001-init.sh   |   28 ++++++++++++++--------------\n t/t7502-commit.sh |    4 ++--\n 2 files changed, 16 insertions(+), 16 deletions(-)\n\ndiff --git a/t/t0001-init.sh b/t/t0001-init.sh\nindex 9d4539f..3c2afb3 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\tunset 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\tunset 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\tunset 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\tunset 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\tunset 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\tunset 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\tunset 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\tunset 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\tunset 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\tunset 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\tunset GIT_CONFIG_NOGLOBAL;\n+\t\tunset 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\tunset 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\tunset 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/t7502-commit.sh b/t/t7502-commit.sh\nindex b6b9802..129ac15 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\tunset GIT_COMMITTER_EMAIL;\n+\t\tunset 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) &&\n-- \n1.7.3.95.g14291\n"},{"id":"151772","messageId":"20100927001037.GA7490@burratino","threadId":"25253","inReplyTo":"1285542879-16381-11-git-send-email-newren@gmail.com","subject":"Re: [PATCHv4 10/15] t6016 (rev-list-graph-simplify-history): add missing &&","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-09-27T00:10:37Z","receivedAt":"2010-09-27T00:10:37Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"(+cc: Adam Simpkins)\nHi,\n\nThanks for doing this tedious work.\n\nElijah Newren wrote:\n\n> Also removed several repeated tag and branch deletions\n\nNit: present tense\n\n> , since the tags and\n> branches had already been deleted.\n\nI suspect the repeated deletions were to allow skipping individual\ntests.  Maybe something like the following on top of your patch\nwould achieve that.\n\nThe rest looks good to me, for what it's worth.\n\ndiff --git a/t/t6016-rev-list-graph-simplify-history.sh b/t/t6016-rev-list-graph-simplify-history.sh\nindex e640c41..5036940 100755\n--- a/t/t6016-rev-list-graph-simplify-history.sh\n+++ b/t/t6016-rev-list-graph-simplify-history.sh\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 '--graph --simplify-by-decoration prune branch B' '\n-\trm -f expected &&\n+test_expect_success 'setup: get rid of decorations on branch B' '\n \tgit tag -d B2 &&\n \tgit tag -d B1 &&\n-\tgit branch -d B &&\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 \techo \"* $A7\" >> expected &&\n \techo \"*   $A6\" >> expected &&\n \techo \"|\\\\  \" >> expected &&\n-- \n"},{"id":"152072","messageId":"7vd3rwo22t.fsf@alter.siamese.dyndns.org","threadId":"25253","inReplyTo":"1285542879-16381-3-git-send-email-newren@gmail.com","subject":"Re: [PATCHv4 02/15] t4017 (diff-retval): replace manual exit code check with test_expect_code","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-29T18:07:54Z","receivedAt":"2010-09-29T18:07:54Z","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> Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> Signed-off-by: Elijah Newren <newren@gmail.com>\n> ---\n>  t/t4017-diff-retval.sh |   30 ++++++++++--------------------\n>  1 files changed, 10 insertions(+), 20 deletions(-)\n>\n> diff --git a/t/t4017-diff-retval.sh b/t/t4017-diff-retval.sh\n> index 6158985..6605e12 100755\n> --- a/t/t4017-diff-retval.sh\n> +++ b/t/t4017-diff-retval.sh\n> @@ -28,37 +28,29 @@ test_expect_success 'git diff --quiet -w  HEAD^ HEAD' '\n>  \ttest_must_fail git diff --quiet -w HEAD^ HEAD\n>  '\n>  \n> -test_expect_success 'git diff-tree HEAD^ HEAD' '\n> +test_expect_code 1 'git diff-tree HEAD^ HEAD' '\n>  \tgit diff-tree --exit-code HEAD^ HEAD\n> -\ttest $? = 1\n>  '\n> -test_expect_success 'git diff-tree HEAD^ HEAD -- a' '\n> +test_expect_code 0 'git diff-tree HEAD^ HEAD -- a' '\n>  \tgit diff-tree --exit-code HEAD^ HEAD -- a\n> -\ttest $? = 0\n>  '\n\nIt probably is better to simply drop \"test $? = 0\" and keep the\nexpect-success, no?\n"},{"id":"152073","messageId":"7v8w2ko14p.fsf@alter.siamese.dyndns.org","threadId":"25253","inReplyTo":"1285542879-16381-4-git-send-email-newren@gmail.com","subject":"Re: [PATCHv4 03/15] t100[12] (read-tree-m-2way, read_tree_m_u_2way): add missing &&","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-29T18:28:22Z","receivedAt":"2010-09-29T18:28:22Z","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> Also, replace \"|| return 1\" with \"&&\" in order to keep commands chained.\n>\n> Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> Signed-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>\n> diff --git a/t/t1001-read-tree-m-2way.sh b/t/t1001-read-tree-m-2way.sh\n> index 93ca84f..ce8112c 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_might_fail git diff --no-index M.out 4.out >4diff.out &&\n\nShouldn't this be must-fail, as we are expecting to see some differences?\n\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_might_fail git diff --no-index M.out 5.out >5diff.out &&\n\nDitto.\n\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_might_fail git diff --no-index M.out 14.out >14diff.out &&\n\nDitto.\n\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_might_fail git diff --no-index M.out 15.out >15diff.out &&\n\nDitto.\n\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` &&\n> diff --git a/t/t1002-read-tree-m-u-2way.sh b/t/t1002-read-tree-m-u-2way.sh\n> index 0241329..a9492e9 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_might_fail git diff -U0 --no-index M.out 14.out >14diff.out &&\n\nDitto.\n\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_might_fail git diff -U0 --no-index M.out 15.out >15diff.out &&\n\nDitto.\n\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> -- \n> 1.7.3.95.g14291\n"},{"id":"152074","messageId":"AANLkTiksEBVUyJnrUETxManHa+ZMCT6+V3C83K75KW2A@mail.gmail.com","threadId":"25253","inReplyTo":"7vd3rwo22t.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCHv4 02/15] t4017 (diff-retval): replace manual exit code check with test_expect_code","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-29T18:45:57Z","receivedAt":"2010-09-29T18:45:57Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Wed, Sep 29, 2010 at 18:07, Junio C Hamano <gitster@pobox.com> wrote:\n> Elijah Newren <newren@gmail.com> writes:\n>\n>> Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n>> Signed-off-by: Elijah Newren <newren@gmail.com>\n>> ---\n>>  t/t4017-diff-retval.sh |   30 ++++++++++--------------------\n>>  1 files changed, 10 insertions(+), 20 deletions(-)\n>>\n>> diff --git a/t/t4017-diff-retval.sh b/t/t4017-diff-retval.sh\n>> index 6158985..6605e12 100755\n>> --- a/t/t4017-diff-retval.sh\n>> +++ b/t/t4017-diff-retval.sh\n>> @@ -28,37 +28,29 @@ test_expect_success 'git diff --quiet -w  HEAD^ HEAD' '\n>>       test_must_fail git diff --quiet -w HEAD^ HEAD\n>>  '\n>>\n>> -test_expect_success 'git diff-tree HEAD^ HEAD' '\n>> +test_expect_code 1 'git diff-tree HEAD^ HEAD' '\n>>       git diff-tree --exit-code HEAD^ HEAD\n>> -     test $? = 1\n>>  '\n\nIt also looks like this will pass for for all exit codes that *aren't*\n1, because if $? != 1 +test_expect_code will get the exit code of\n1. But if it's 1 then test $? = 0 will return 0, right?\n\n>> -test_expect_success 'git diff-tree HEAD^ HEAD -- a' '\n>> +test_expect_code 0 'git diff-tree HEAD^ HEAD -- a' '\n>>       git diff-tree --exit-code HEAD^ HEAD -- a\n>> -     test $? = 0\n>>  '\n>\n> It probably is better to simply drop \"test $? = 0\" and keep the\n> expect-success, no?\n\nYes.\n"},{"id":"152075","messageId":"7v4od8nzl9.fsf@alter.siamese.dyndns.org","threadId":"25253","inReplyTo":"1285542879-16381-8-git-send-email-newren@gmail.com","subject":"Re: [PATCHv4 07/15] t4019 (diff-wserror): add lots of missing &&","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-29T19:01:38Z","receivedAt":"2010-09-29T19:01:38Z","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> Also add a test_might_fail in front of the final git_config --unset\n> core.whitespace as that value may have already been unset previously.\n\nIn general, if a previous one that is designed to set a variable failed\nfor whatever reason, the next one that does --unset without might-fail\nwill be broken.  So...\n\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> +\tgit config --unset core.whitespace &&\n\n... I think you need might-fail in front of this one, and ...\n\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> +\tgit config --unset core.whitespace &&\n\n... this one, ...\n\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\n... this one, ...\n\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> +\tgit config --unset core.whitespace &&\n\n... this one, ...\n\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> +\tgit config --unset core.whitespace &&\n\n\n... and this one, too.\n\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> -- \n> 1.7.3.95.g14291\n"},{"id":"152076","messageId":"7vzkv0mkn5.fsf@alter.siamese.dyndns.org","threadId":"25253","inReplyTo":"1285542879-16381-10-git-send-email-newren@gmail.com","subject":"Re: [PATCHv4 09/15] t5602 (clone-remote-exec): add missing &&","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-29T19:09:50Z","receivedAt":"2010-09-29T19:09:50Z","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> Also add a couple test_must_fail invocations where needed.\n>\n> Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> Signed-off-by: Elijah Newren <newren@gmail.com>\n> ---\n>  t/t5602-clone-remote-exec.sh |   14 +++++++-------\n>  1 files changed, 7 insertions(+), 7 deletions(-)\n>\n> diff --git a/t/t5602-clone-remote-exec.sh b/t/t5602-clone-remote-exec.sh\n> index deffdae..6aa6e0d 100755\n> --- a/t/t5602-clone-remote-exec.sh\n> +++ b/t/t5602-clone-remote-exec.sh\n> @@ -5,21 +5,21 @@ 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> +\tGIT_SSH=./not_ssh test_must_fail git clone localhost:/path/to/repo junk &&\n\nI think this suffers from the same issue that have been fixed with 09b78bc\n(t7502-commit.sh: rearrange test to make more portable, 2008-07-22) and\n2d60615 (tests: Avoid single-shot environment export for shell function\ninvocation, 2009-01-26).\n\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> +\tGIT_SSH=./not_ssh test_must_fail git clone -u ./something/bin/git-upload-pack localhost:/path/to/repo junk &&\n\nSo does this.\n\n> +\techo \"localhost ./something/bin/git-upload-pack '\\''/path/to/repo'\\''\" >expected &&\n>  \ttest_cmp expected not_ssh_output\n>  '\n>  \n> -- \n> 1.7.3.95.g14291\n"},{"id":"152078","messageId":"7vmxr0mjcj.fsf@alter.siamese.dyndns.org","threadId":"25253","inReplyTo":"1285542879-16381-15-git-send-email-newren@gmail.com","subject":"Re: [PATCHv4 14/15] Add missing &&'s throughout the testsuite","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-29T19:37:48Z","receivedAt":"2010-09-29T19:37:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Elijah Newren <newren@gmail.com> writes:\n\n> diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh\n> index de38c7f..ddd1c23 100755\n> --- a/t/t0003-attributes.sh\n> +++ b/t/t0003-attributes.sh\n> @@ -19,24 +19,23 @@ 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> -\n> +\tcat <<EOF >.gitattributes &&\n\nIf you are not doing any variable substitution in the here document,\nplease quote EOF to make it clear, i.e.\n\n\tcat >.gitattributes <<\\EOF &&\n\n> @@ -73,7 +72,7 @@ offon: test: set\n>  no: test: unspecified\n>  a/b/d/no: test: a/b/d/*\n>  a/b/d/yes: test: unspecified\n> -EOF\n> +EOF &&\n\nHuh?  Cascading && (or ||) goes on the first line of <<HERE document, as\nyou wrote yourself in the above ;-)\n\n> diff --git a/t/t4119-apply-config.sh b/t/t4119-apply-config.sh\n> index 3c73a78..3d0384d 100755\n> --- a/t/t4119-apply-config.sh\n> +++ b/t/t4119-apply-config.sh\n> @@ -73,7 +73,7 @@ D=`pwd`\n>  test_expect_success 'apply --whitespace=strip in subdir' '\n>  \n>  \tcd \"$D\" &&\n> -\tgit config --unset-all apply.whitespace\n> +\tgit config --unset-all apply.whitespace &&\n\nAt this point, do we know that the previous test that added\napply.whitespace to $D's configuration has successfully run and left the\nvariable, or do we need to say this might-fail?\n\n> diff --git a/t/t8003-blame.sh b/t/t8003-blame.sh\n> index 230143c..ddabf4f 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> +  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> +EOF &&\n\nHuh, again?\n"},{"id":"152079","messageId":"7viq1omiv8.fsf@alter.siamese.dyndns.org","threadId":"25253","inReplyTo":"1285542879-16381-16-git-send-email-newren@gmail.com","subject":"Re: [PATCHv4 15/15] Replace \"unset VAR\" with \"unset VAR;\" in testsuite as per t/README","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-29T19:48:11Z","receivedAt":"2010-09-29T19:48:11Z","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> Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> Signed-off-by: Elijah Newren <newren@gmail.com>\n> ---\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\tunset GIT_CONFIG_NOGLOBAL;\n> +\t\tunset 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\tunset 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\tunset 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 &&\n\nThese three hunks look wrong as they break the && cascades.  All others\n(including the change to 7502) look Ok.\n\nPersonally I do not agree that \";\" at the end is explicit enough as\nt/README seems to think.  If we want to be explicit, I'd say we should do\nso by saying something like:\n\n\tunset VAR ;# can fail\n"},{"id":"152082","messageId":"AANLkTimPQ+CHugJnMPCjCrcAF9sd86mh=Ors8sgwQTUU@mail.gmail.com","threadId":"25253","inReplyTo":"7viq1omiv8.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCHv4 15/15] Replace \"unset VAR\" with \"unset VAR;\" in testsuite as per t/README","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-29T20:28:30Z","receivedAt":"2010-09-29T20:28:30Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Wed, Sep 29, 2010 at 19:48, Junio C Hamano <gitster@pobox.com> wrote:\n> Elijah Newren <newren@gmail.com> writes:\n>\n>> Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n>> Signed-off-by: Elijah Newren <newren@gmail.com>\n>> ---\n>> @@ -175,8 +175,8 @@ test_expect_success 'init with init.templatedir set' '\n>>               git config -f \"$test_config\"  init.templatedir \"${HOME}/templatedir-source\" &&\n>>               mkdir templatedir-set &&\n>>               cd templatedir-set &&\n>> -             unset GIT_CONFIG_NOGLOBAL &&\n>> -             unset GIT_TEMPLATE_DIR &&\n>> +             unset GIT_CONFIG_NOGLOBAL;\n>> +             unset GIT_TEMPLATE_DIR;\n>>               NO_SET_GIT_TEMPLATE_DIR=t &&\n>>               export NO_SET_GIT_TEMPLATE_DIR &&\n>>               git 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>>       (\n>>               test_config=\"$HOME\"/.gitconfig &&\n>> -             unset GIT_CONFIG_NOGLOBAL &&\n>> +             unset GIT_CONFIG_NOGLOBAL;\n>>               git config -f \"$test_config\" core.bare false &&\n>>               git config -f \"$test_config\" core.sharedRepository 0640 &&\n>>               mkdir 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>>       (\n>>               test_config=\"$HOME\"/.gitconfig &&\n>> -             unset GIT_CONFIG_NOGLOBAL &&\n>> +             unset GIT_CONFIG_NOGLOBAL;\n>>               git config -f \"$test_config\" core.sharedRepository 0666 &&\n>>               mkdir shared-honor-global &&\n>>               cd shared-honor-global &&\n>\n> These three hunks look wrong as they break the && cascades.  All others\n> (including the change to 7502) look Ok.\n>\n> Personally I do not agree that \";\" at the end is explicit enough as\n> t/README seems to think.  If we want to be explicit, I'd say we should do\n> so by saying something like:\n>\n>        unset VAR ;# can fail\n\nOr, as previously suggested:\n\n    test_might_fail unset VAR &&\n\nDoesn't test_might_fail work for the unset build-in too?\n"},{"id":"152087","messageId":"AANLkTimgTAerCNcSHBR9t-s-ThWHLMXdsb2T=E2w8gpB@mail.gmail.com","threadId":"25253","inReplyTo":"7viq1omiv8.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCHv4 15/15] Replace \"unset VAR\" with \"unset VAR;\" in testsuite as per t/README","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-09-29T20:30:19Z","receivedAt":"2010-09-29T20:30:19Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Hi,\n\nThanks for all the reviews.  I'll fix things up.  One question on this\nlast one...\n\nOn Wed, Sep 29, 2010 at 1:48 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Elijah Newren <newren@gmail.com> writes:\n>\n>> Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n>> Signed-off-by: Elijah Newren <newren@gmail.com>\n>> ---\n>> @@ -175,8 +175,8 @@ test_expect_success 'init with init.templatedir set' '\n>>               git config -f \"$test_config\"  init.templatedir \"${HOME}/templatedir-source\" &&\n>>               mkdir templatedir-set &&\n>>               cd templatedir-set &&\n>> -             unset GIT_CONFIG_NOGLOBAL &&\n>> -             unset GIT_TEMPLATE_DIR &&\n>> +             unset GIT_CONFIG_NOGLOBAL;\n>> +             unset GIT_TEMPLATE_DIR;\n>>               NO_SET_GIT_TEMPLATE_DIR=t &&\n>>               export NO_SET_GIT_TEMPLATE_DIR &&\n>>               git 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>>       (\n>>               test_config=\"$HOME\"/.gitconfig &&\n>> -             unset GIT_CONFIG_NOGLOBAL &&\n>> +             unset GIT_CONFIG_NOGLOBAL;\n>>               git config -f \"$test_config\" core.bare false &&\n>>               git config -f \"$test_config\" core.sharedRepository 0640 &&\n>>               mkdir 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>>       (\n>>               test_config=\"$HOME\"/.gitconfig &&\n>> -             unset GIT_CONFIG_NOGLOBAL &&\n>> +             unset GIT_CONFIG_NOGLOBAL;\n>>               git config -f \"$test_config\" core.sharedRepository 0666 &&\n>>               mkdir shared-honor-global &&\n>>               cd shared-honor-global &&\n>\n> These three hunks look wrong as they break the && cascades.  All others\n> (including the change to 7502) look Ok.\n\nThey break the && cascades, but aren't the && cascades already\ninherently broken due to the unportable return value of unset?\n\n> Personally I do not agree that \";\" at the end is explicit enough as\n> t/README seems to think.  If we want to be explicit, I'd say we should do\n> so by saying something like:\n>\n>        unset VAR ;# can fail\n\nThat makes sense.  Alternatively, I asked in an earlier posting of\nthis series whether it would it make sense to add a\n  portable_unset () {\n    unset $* || true\n  }\nhelper function to test-lib, and just use it instead of unset?  That\nwould allow proper chaining everywhere.  Thoughts?\n"},{"id":"152169","messageId":"7v39srkyax.fsf@alter.siamese.dyndns.org","threadId":"25253","inReplyTo":"AANLkTimgTAerCNcSHBR9t-s-ThWHLMXdsb2T=E2w8gpB@mail.gmail.com","subject":"Re: [PATCHv4 15/15] Replace \"unset VAR\" with \"unset VAR;\" in testsuite as per t/README","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-30T16:09:58Z","receivedAt":"2010-09-30T16:09:58Z","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> They break the && cascades, but aren't the && cascades already\n> inherently broken due to the unportable return value of unset?\n\nOf course; that is the breakage you are trying to fix, no?  My comment was\nthat I understand you are trying to, but the patch is not actually fixing\nit.\n\nIf anything, it is making it worse. Earlier we would have got a false\nbreakage that would make people notice and take a look. With your patch\napplied, we instead would let a breakage in parts earlier than these\n\"unset VAR;\" go unnoticed, no?\n"},{"id":"152199","messageId":"AANLkTimmSLwZaGvM1j7CQtTzd7mJXSiBDHztj4S97rOr@mail.gmail.com","threadId":"25253","inReplyTo":"7v39srkyax.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCHv4 15/15] Replace \"unset VAR\" with \"unset VAR;\" in testsuite as per t/README","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-09-30T21:51:49Z","receivedAt":"2010-09-30T21:51:49Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Thu, Sep 30, 2010 at 10:09 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Elijah Newren <newren@gmail.com> writes:\n>\n>> They break the && cascades, but aren't the && cascades already\n>> inherently broken due to the unportable return value of unset?\n>\n> Of course; that is the breakage you are trying to fix, no?  My comment was\n> that I understand you are trying to, but the patch is not actually fixing\n> it.\n>\n> If anything, it is making it worse. Earlier we would have got a false\n> breakage that would make people notice and take a look. With your patch\n> applied, we instead would let a breakage in parts earlier than these\n> \"unset VAR;\" go unnoticed, no?\n\nRight.\n\nWhat do you think of the previous suggestions in this thread for a\nportable_unset() function, or for using test_might_fail in front of\nall these unset commands (despite t/README saying that test_might_fail\nis only for running git commands)?\n"},{"id":"152208","messageId":"AANLkTim6ca=8pis2X8Xrc1bGB0YCtYRxCpY3pMdA0QvU@mail.gmail.com","threadId":"25253","inReplyTo":"1285542879-16381-15-git-send-email-newren@gmail.com","subject":"Re: [PATCHv4 14/15] Add missing &&'s throughout the testsuite","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-10-01T00:48:29Z","receivedAt":"2010-10-01T00:48:29Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sun, Sep 26, 2010 at 23:14, Elijah Newren <newren@gmail.com> wrote:\n\n>  test_expect_success 'did not use upload-pack service' '\n> -       grep '/git-upload-pack' <\"$HTTPD_ROOT_PATH\"/access.log >act\n> -       : >exp\n> +       grep '/git-upload-pack' <\"$HTTPD_ROOT_PATH\"/access.log >act &&\n> +       >exp &&\n>        test_cmp exp act\n>  '\n\nThis test started failing in pu, I'm presuming you didn't spot it\nsince you didn't run the tests with GIT_TEST_HTTPD=1.\n\nAnyway, that grep should be a \"! grep\" to work with &&.\n"},{"id":"152222","messageId":"20101001102315.GA6816@burratino","threadId":"25253","inReplyTo":"AANLkTiksEBVUyJnrUETxManHa+ZMCT6+V3C83K75KW2A@mail.gmail.com","subject":"Re: [PATCHv4 02/15] t4017 (diff-retval): replace manual exit code check with test_expect_code","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-01T10:23:15Z","receivedAt":"2010-10-01T10:23:15Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n> On Wed, Sep 29, 2010 at 18:07, Junio C Hamano <gitster@pobox.com> wrote:\n>> Elijah Newren <newren@gmail.com> writes:\n\n>>> -test_expect_success 'git diff-tree HEAD^ HEAD' '\n>>> +test_expect_code 1 'git diff-tree HEAD^ HEAD' '\n>>>       git diff-tree --exit-code HEAD^ HEAD\n>>> -     test $? = 1\n>>>  '\n>\n> It also looks like this will pass for for all exit codes that *aren't*\n> 1, because if $? != 1 +test_expect_code will get the exit code of\n> 1.\n\nYou probably missed the - indicating that the \"test $? = 1\" was being\nremoved.\n\nBut using test_expect_code indeed has a similar problem to the one\nyou point out: it does not nicely discern between outcomes in a test\nwith multiple commands.  This shows up in some of the later tests in\nthis script (which is presumably why the original patch did not\ntouch them).\n\nMaybe something like this would improve things?\n\n-- 8< --\nSubject: t4017 (diff-retval): factor out check_exit_status helper\n\nWhen reporting a difference with --exit-code, diff is not only\nsupposed to fail but to fail with status 1.  Unfortunately, the shell\ncode to check for that has to amount to\n\n\tgit diff --exit-code this that\n\ttest $? = 1\n\nwhich breaks &&-chaining if the script author is not cautious.\n\nThis test script already avoids trouble by putting such code in { }\nblocks, but that is a bit clunky; better to notice the pattern and\ngive it its own function.\n\nWhile at it, improve the output on failure when debugging with -v\nby printing the expected and actual exit code (by using test_cmp).\nThe temporary files expect.status and actual.status used to\nbring this about do not adversely affect the test because those\nfilenames are not tracked, hence not candidates for diffing.\n\nNoticed-by: Elijah Newren <newren@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/t4017-diff-retval.sh |   93 ++++++++++++++++-------------------------------\n 1 files changed, 32 insertions(+), 61 deletions(-)\n\ndiff --git a/t/t4017-diff-retval.sh b/t/t4017-diff-retval.sh\nindex 6158985..51a009b 100755\n--- a/t/t4017-diff-retval.sh\n+++ b/t/t4017-diff-retval.sh\n@@ -4,6 +4,14 @@ test_description='Return value of diffs'\n \n . ./test-lib.sh\n \n+check_exit_status () {\n+\techo \"$1\" >expect.status\n+\tshift\n+\t\"$@\"\n+\techo \"$?\" >actual.status\n+\ttest_cmp expect.status actual.status\n+}\n+\n test_expect_success 'setup' '\n \techo \"1 \" >a &&\n \tgit add . &&\n@@ -21,110 +29,81 @@ test_expect_success 'git diff --quiet -w  HEAD^^ HEAD^' '\n '\n \n test_expect_success 'git diff --quiet HEAD^^ HEAD^' '\n-\ttest_must_fail git diff --quiet HEAD^^ HEAD^\n+\tcheck_exit_status 1 git diff --quiet HEAD^^ HEAD^\n '\n \n test_expect_success 'git diff --quiet -w  HEAD^ HEAD' '\n-\ttest_must_fail git diff --quiet -w HEAD^ HEAD\n+\tcheck_exit_status 1 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+\tcheck_exit_status 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+\tcheck_exit_status 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+\tgit rev-parse HEAD |\n+\tcheck_exit_status 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+\tcheck_exit_status 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+\tcheck_exit_status 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+\tcheck_exit_status 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+\tcheck_exit_status 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+\tcheck_exit_status 1 git diff-index --exit-code --cached HEAD\n '\n \n test_expect_success '--check --exit-code returns 0 for no difference' '\n-\n \tgit diff --check --exit-code\n-\n '\n \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-\n+\techo \"good\" >a &&\n+\tcheck_exit_status 1 git diff --check --exit-code\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-\n+\tcheck_exit_status 3 git diff --check --exit-code\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-\n+\tcheck_exit_status 2 git --no-pager diff --check\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-\n+\tcheck_exit_status 2 git --no-pager diff --check\n '\n \n test_expect_success 'check detects leftover conflict markers' '\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+\tcheck_exit_status 2 git --no-pager diff --cached --check >test.out &&\n \ttest 3 = $(grep \"conflict marker\" test.out | wc -l) &&\n \tgit reset --hard\n '\n@@ -146,19 +123,13 @@ test_expect_success 'check honors conflict marker length' '\n \techo \">>>>>>> boo\" >>b &&\n \techo \"======\" >>a &&\n \tgit diff --check a &&\n-\t(\n-\t\tgit diff --check b\n-\t\ttest $? = 2\n-\t) &&\n+\tcheck_exit_status 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+\tcheck_exit_status 2 git diff --check b &&\n \tgit diff --check a &&\n \tgit reset --hard\n '\n-- \n1.7.2.3\n"},{"id":"152223","messageId":"20101001102724.GB6816@burratino","threadId":"25253","inReplyTo":"7v8w2ko14p.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCHv4 03/15] t100[12] (read-tree-m-2way, read_tree_m_u_2way): add missing &&","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-01T10:27:24Z","receivedAt":"2010-10-01T10:27:24Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n> Elijah Newren <newren@gmail.com> writes:\n\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_might_fail git diff --no-index M.out 4.out >4diff.out &&\n>\n> Shouldn't this be must-fail, as we are expecting to see some differences?\n\nI see you've fixed this up already.  Thanks.\n"},{"id":"152224","messageId":"20101001103514.GC6816@burratino","threadId":"25253","inReplyTo":"1285542879-16381-5-git-send-email-newren@gmail.com","subject":"Re: [PATCHv4 04/15] t4002 (diff-basic): use test_might_fail for commands that might fail","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-01T10:35:14Z","receivedAt":"2010-10-01T10:35:14Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Elijah Newren wrote:\n\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_might_fail git update-index --refresh >/dev/null &&\n>       git diff-files >.test-a &&\n\nMakes sense; thanks.  But aren't we actually guaranteed that it will\nfail, since the index does not match the work tree?\n\nMeanwhile, what was the point of refreshing the index like this?\nI would guess it was to make sure that files that match the work tree\nare marked as matching, but if so, this is not guaranteed if\nupdate-index --refresh exits early.  Adding -q would fix that.\n\nWhy redirect to /dev/null?  I would think the extra output would\nbe useful while debugging with -v.\n---\ndiff --git a/t/t4002-diff-basic.sh b/t/t4002-diff-basic.sh\nindex 340aa7d..9fb8ca0 100755\n--- a/t/t4002-diff-basic.sh\n+++ b/t/t4002-diff-basic.sh\n@@ -206,7 +206,7 @@ test_expect_success \\\n      git read-tree $tree_A &&\n      git checkout-index -f -a &&\n      git read-tree --reset $tree_O &&\n-     test_might_fail git update-index --refresh >/dev/null &&\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@@ -216,7 +216,7 @@ test_expect_success \\\n      git read-tree $tree_B &&\n      git checkout-index -f -a &&\n      git read-tree --reset $tree_O &&\n-     test_might_fail git update-index --refresh >/dev/null &&\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@@ -226,7 +226,7 @@ test_expect_success \\\n      git read-tree $tree_B &&\n      git checkout-index -f -a &&\n      git read-tree --reset $tree_A &&\n-     test_might_fail git update-index --refresh >/dev/null &&\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-- \n"},{"id":"152225","messageId":"AANLkTinqVTqxiHL5tEv+-SS6YURGUoWaPxCgpccZgjEq@mail.gmail.com","threadId":"25253","inReplyTo":"20101001102315.GA6816@burratino","subject":"Re: [PATCHv4 02/15] t4017 (diff-retval): replace manual exit code check with test_expect_code","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-10-01T10:38:32Z","receivedAt":"2010-10-01T10:38:32Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Oct 1, 2010 at 10:23, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n>> On Wed, Sep 29, 2010 at 18:07, Junio C Hamano <gitster@pobox.com> wrote:\n>>> Elijah Newren <newren@gmail.com> writes:\n>\n>>>> -test_expect_success 'git diff-tree HEAD^ HEAD' '\n>>>> +test_expect_code 1 'git diff-tree HEAD^ HEAD' '\n>>>>       git diff-tree --exit-code HEAD^ HEAD\n>>>> -     test $? = 1\n>>>>  '\n>>\n>> It also looks like this will pass for for all exit codes that *aren't*\n>> 1, because if $? != 1 +test_expect_code will get the exit code of\n>> 1.\n>\n> You probably missed the - indicating that the \"test $? = 1\" was being\n> removed.\n\nCorrect. I misread that.\n\n> +check_exit_status () {\n> +       echo \"$1\" >expect.status\n> +       shift\n> +       \"$@\"\n> +       echo \"$?\" >actual.status\n> +       test_cmp expect.status actual.status\n> +}\n\nIf we add this it should be in the test-lib.sh, it'll probably be\nuseful for other tests.\n\n>  test_expect_success 'setup' '\n>        echo \"1 \" >a &&\n>        git add . &&\n> @@ -21,110 +29,81 @@ test_expect_success 'git diff --quiet -w  HEAD^^ HEAD^' '\n>  '\n>\n>  test_expect_success 'git diff --quiet HEAD^^ HEAD^' '\n> -       test_must_fail git diff --quiet HEAD^^ HEAD^\n> +       check_exit_status 1 git diff --quiet HEAD^^ HEAD^\n>  '\n\nIn most uses of check_exit_status you're using it is the very last\ncommand within a test_expect_success. Isn't it redundant to using just\n\"test_expect_code $code ...\" there?\n\n>  test_expect_success 'check detects leftover conflict markers' '\n> @@ -133,10 +112,8 @@ test_expect_success 'check detects leftover conflict markers' '\n>        echo binary >>b &&\n>        git commit -m \"side\" b &&\n>        test_must_fail git merge master &&\n> -       git add b && (\n> -               git --no-pager diff --cached --check >test.out\n> -               test $? = 2\n> -       ) &&\n> +       git add b &&\n> +       check_exit_status 2 git --no-pager diff --cached --check >test.out &&\n>        test 3 = $(grep \"conflict marker\" test.out | wc -l) &&\n>        git reset --hard\n>  '\n\nBut of course in cases like these it's needed.\n\nIn any case, we only use test_expect_code for two tests in the whole\ntest suite now, and checking the exit status for individual commands\nis more self-documenting and less prone to break if we add more tests\nto a given test.\n\nSo IMO the best thing to do would be to re-appropriate\n\"test_expect_code\" so that it runs inside a test (i.e. does what your\ncheck_exit_status does), and not at the top-level.\n\nThen do s/check_exit_status/test_expect_code/g on your patch, and\nchange the tests using test_expect_code in t1504-ceiling-dirs.sh and\nt6020-merge-df.sh to use test_expect_success + test_expect_code.\n"},{"id":"152226","messageId":"20101001104823.GD6816@burratino","threadId":"25253","inReplyTo":"1285542879-16381-7-git-send-email-newren@gmail.com","subject":"Re: [PATCHv4 06/15] t3600 (rm): add lots of missing &&","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-01T10:48:23Z","receivedAt":"2010-10-01T10:48:23Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Elijah Newren wrote:\n\n> Also delete unnecessary, failing code and add some test_when_finished\n> calls to make sure tests clean up after themselves.\n\nI don't understand this one.\n\nIf tests clean up after themselves, each will restore some pristine\nstate as though (at least as far as the other tests care) it had never\nrun at all, right?\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 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\nBefore this runs: foo is empty, absent from index.\nAfter it runs: foo has content, still absent from index.\nRequires: nothing.\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> +     test_when_finished \"git checkout HEAD -- foo\" &&\n>       git rm --cached foo'\n\nBefore this runs: foo has content, absent from index.\nAfter this runs (without patch): foo has other content, absent from index.\nAfter this runs (with patch): foo has content, matching index.\nRequires: nothing.\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> +     echo \"other content\" > foo &&\n> +     git add foo &&\n> +     echo \"yet another content\" > foo &&\n> +     test_when_finished \"git checkout HEAD -- foo\" &&\n>       test_must_fail git rm --cached foo\n>  '\n\nBefore this runs: see above.\nAfter this runs (without patch): foo has yet another content, absent from index.\nAfter this runs (with patch): foo has content, matching index.\nRequires (without patch): nothing.\nRequires (with patch): HEAD:foo is content.\n\n[etc]\n\nSo if I understand correctly, this sacrifices the ability to\nskip individual tests.  What does one gain in return?\n"},{"id":"152227","messageId":"20101001110005.GE6816@burratino","threadId":"25253","inReplyTo":"1285542879-16381-8-git-send-email-newren@gmail.com","subject":"Re: [PATCHv4 07/15] t4019 (diff-wserror): add lots of missing &&","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-01T11:00:05Z","receivedAt":"2010-10-01T11:00:05Z","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\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\n(I haven't thought hard about the answer.  If we shouldn't be, a\nworkaround could look like this.)\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+\t:\n }\n \n test_expect_success default '\n-- \n"},{"id":"152230","messageId":"20101001112647.GF6816@burratino","threadId":"25253","inReplyTo":"1285542879-16381-15-git-send-email-newren@gmail.com","subject":"Re: [PATCHv4 14/15] Add missing &&'s throughout the testsuite","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-01T11:26:47Z","receivedAt":"2010-10-01T11:26:47Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"(+cc: Duy for t1509)\n\nElijah Newren wrote:\n\n> --- a/t/t0003-attributes.sh\n> +++ b/t/t0003-attributes.sh\n> @@ -19,24 +19,23 @@ 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> +\tcat <<EOF >.gitattributes &&\n> +[attr]notest !test\n\nFits with the style of later tests in the file.  Nice.\n\n[...]\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\nHmm, I am not sure I trust this one...\n\n[...]\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> +\tgit 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> +\tgit 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> +\tgit reset --hard start &&\n>          git config rebase.stat true &&\n>          git rebase -n master >diffstat.txt &&\n>          ! grep \"^ fileX |  *1 +$\" diffstat.txt\n\nShouldn't these tabs be spaces to blend in with their surroundings?\n\n> --- a/t/t4119-apply-config.sh\n> +++ b/t/t4119-apply-config.sh\n> @@ -73,7 +73,7 @@ D=`pwd`\n>  test_expect_success 'apply --whitespace=strip in subdir' '\n>  \n>  \tcd \"$D\" &&\n> -\tgit config --unset-all apply.whitespace\n> +\tgit config --unset-all apply.whitespace &&\n\ntest_might_fail?\n\nAside from the problems Ævar and Junio found, the rest looks good to\nme, but I have not tested it.\n---\ndiff --git a/t/t1509-root-worktree.sh b/t/t1509-root-worktree.sh\nindex e3391b7..7f60fd0 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/t3406-rebase-message.sh b/t/t3406-rebase-message.sh\nindex fe5f936..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-\tgit 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-\tgit 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-\tgit 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/t4119-apply-config.sh b/t/t4119-apply-config.sh\nindex 3d0384d..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 &&\n-- \n"},{"id":"152229","messageId":"20101001113052.GG6816@burratino","threadId":"25253","inReplyTo":"1285542879-16381-14-git-send-email-newren@gmail.com","subject":"Re: [PATCHv4 13/15] t7800 (difftool): add missing &&","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-01T11:30:52Z","receivedAt":"2010-10-01T11:30:52Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Elijah Newren wrote:\n\n> Also remove a call to 'git config --unset difftool.prompt', since that is\n> already unset by restore_test_defaults.\n\nIsn't the restore_test_defaults call at the end of the previous test?\nIt might not be reached.\n\nHow about this?\n\ndiff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh\nindex c45abf3..4048d10 100755\n--- a/t/t7800-difftool.sh\n+++ b/t/t7800-difftool.sh\n@@ -166,6 +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+\ttest_might_fail git config --unset difftool.prompt &&\n \tgit config mergetool.prompt false &&\n \n \tdiff=$(git difftool branch) &&\n-- \n"},{"id":"152231","messageId":"20101001113412.GH6816@burratino","threadId":"25253","inReplyTo":"7vzkv0mkn5.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCHv4 09/15] t5602 (clone-remote-exec): add missing &&","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-01T11:34:13Z","receivedAt":"2010-10-01T11:34:13Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n> Elijah Newren <newren@gmail.com> writes:\n\n>> +\tGIT_SSH=./not_ssh test_must_fail git clone localhost:/path/to/repo junk &&\n>\n> I think this suffers from the same issue that have been fixed with 09b78bc\n> (t7502-commit.sh: rearrange test to make more portable, 2008-07-22) and\n> 2d60615 (tests: Avoid single-shot environment export for shell function\n> invocation, 2009-01-26).\n\nHere's a patch for squashing.\n\nThanks again.\n\ndiff --git a/t/t5602-clone-remote-exec.sh b/t/t5602-clone-remote-exec.sh\nindex 6aa6e0d..3f353d9 100755\n--- a/t/t5602-clone-remote-exec.sh\n+++ b/t/t5602-clone-remote-exec.sh\n@@ -12,13 +12,21 @@ test_expect_success setup '\n '\n \n test_expect_success 'clone calls git upload-pack unqualified with no -u option' '\n-\tGIT_SSH=./not_ssh test_must_fail git clone localhost:/path/to/repo junk &&\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 test_must_fail git clone -u ./something/bin/git-upload-pack localhost:/path/to/repo junk &&\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"},{"id":"152232","messageId":"20101001114514.GA18405@burratino","threadId":"25253","inReplyTo":"AANLkTimmSLwZaGvM1j7CQtTzd7mJXSiBDHztj4S97rOr@mail.gmail.com","subject":"Re: [PATCHv4 15/15] Replace \"unset VAR\" with \"unset VAR;\" in testsuite as per t/README","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-01T11:45:14Z","receivedAt":"2010-10-01T11:45:14Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Elijah Newren wrote:\n\n> What do you think of the previous suggestions in this thread for a\n> portable_unset() function\n\nThat sounds fine.  Or if they are rare enough, one can use\n\n { unset FOO BAR BAZ || :; }\n\n> , or for using test_might_fail in front of\n> all these unset commands\n\nI fear this would make it harder for new readers to understand what\ntest_might_fail does.  But if a new function to run \"foo || true\" is\nneeded, I wouldn't be opposed to adding one with a different name.\n"},{"id":"152233","messageId":"20101001115224.GB18405@burratino","threadId":"25253","inReplyTo":"AANLkTinqVTqxiHL5tEv+-SS6YURGUoWaPxCgpccZgjEq@mail.gmail.com","subject":"Re: [PATCHv4 02/15] t4017 (diff-retval): replace manual exit code check with test_expect_code","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-01T11:52:24Z","receivedAt":"2010-10-01T11:52:24Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n> On Fri, Oct 1, 2010 at 10:23, Jonathan Nieder <jrnieder@gmail.com> wrote:\n\n>> +check_exit_status () {\n>> +       echo \"$1\" >expect.status\n>> +       shift\n>> +       \"$@\"\n>> +       echo \"$?\" >actual.status\n>> +       test_cmp expect.status actual.status\n>> +}\n>\n> If we add this it should be in the test-lib.sh, it'll probably be\n> useful for other tests.\n\nFWIW a more generally useful function would have to look something\nlike this:\n\ntest_exit_status () {\n\twant_code=$1\n\tshift\n\t\"$@\"\n\texit_code=$?\n\tif test $exit_code = $want_code\n\tthen\n\t\treturn 0\n\telse\n\t\techo >&2 \"test_exit_status $want_code: command had status $exit_code: $*\"\n\t\treturn 1\n\tfi\n}\n\nto avoid touching the file system.\n\n>                                                               and\n> change the tests using test_expect_code in t1504-ceiling-dirs.sh and\n> t6020-merge-df.sh to use test_expect_success + test_expect_code.\n\nNot a bad thing to do anyway.\n"},{"id":"152238","messageId":"AANLkTinQDEX8e96xfGNNKYbEZAAmO9gBjU43aWGheR8C@mail.gmail.com","threadId":"25253","inReplyTo":"20101001114514.GA18405@burratino","subject":"Re: [PATCHv4 15/15] Replace \"unset VAR\" with \"unset VAR;\" in testsuite as per t/README","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2010-10-01T14:39:37Z","receivedAt":"2010-10-01T14:39:37Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Fri, Oct 1, 2010 at 13:45, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> I fear this would make it harder for new readers to understand what\n> test_might_fail does.  But if a new function to run \"foo || true\" is\n> needed, I wouldn't be opposed to adding one with a different name.\n\ncmd_might_fail?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"152244","messageId":"7vd3rtholo.fsf@alter.siamese.dyndns.org","threadId":"25253","inReplyTo":"AANLkTinqVTqxiHL5tEv+-SS6YURGUoWaPxCgpccZgjEq@mail.gmail.com","subject":"Re: [PATCHv4 02/15] t4017 (diff-retval): replace manual exit code check with test_expect_code","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-10-01T16:20:03Z","receivedAt":"2010-10-01T16:20:03Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n> On Fri, Oct 1, 2010 at 10:23, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>\n>>  test_expect_success 'git diff --quiet HEAD^^ HEAD^' '\n>> -       test_must_fail git diff --quiet HEAD^^ HEAD^\n>> +       check_exit_status 1 git diff --quiet HEAD^^ HEAD^\n>>  '\n>\n> In most uses of check_exit_status you're using it is the very last\n> command within a test_expect_success. Isn't it redundant to using just\n> \"test_expect_code $code ...\" there?\n\nDoesn't\n\n\ttest_expect_code 1 'phoney' '\n        \tfoo && bar && (exit 1)\n\t'\n\nincorrectly succeed if \"foo\" or \"bar\" happened to fail with exit status 1?\n\n> So IMO the best thing to do would be to re-appropriate\n> \"test_expect_code\" so that it runs inside a test (i.e. does what your\n> check_exit_status does), and not at the top-level.\n\nI like it.  It should have been done the way you suggest from the\nbeginning.  It is unfortunate that we didn't think of wrappers like\ntest_must_fail and friends when we originally did test_expect_code, but it\nis never too late to correct that mistake.\n"},{"id":"152246","messageId":"1285953391-29840-1-git-send-email-avarab@gmail.com","threadId":"25253","inReplyTo":"7vd3rtholo.fsf@alter.siamese.dyndns.org","subject":"[PATCH] test-lib: make test_expect_code a test command","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-10-01T17:16:31Z","receivedAt":"2010-10-01T17:16:31Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change 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>\n---\n\nOn Fri, Oct 1, 2010 at 16:20, Junio C Hamano <gitster@pobox.com> wrote:\n> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n>> So IMO the best thing to do would be to re-appropriate\n>> \"test_expect_code\" so that it runs inside a test (i.e. does what your\n>> check_exit_status does), and not at the top-level.\n>\n> I like it.  It should have been done the way you suggest from the\n> beginning.  It is unfortunate that we didn't think of wrappers like\n> test_must_fail and friends when we originally did test_expect_code, but it\n> is never too late to correct that mistake.\n\nHere's a patch to implement that. It goes on top of master so Elijah\nNewren's patch presumably will have to be re-done on top of 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.159.g610493\n"},{"id":"152248","messageId":"AANLkTim1_Zfbrt4G_S2hj1zfF0VX-fM1AkwFyPp0B1qE@mail.gmail.com","threadId":"25253","inReplyTo":"1285953391-29840-1-git-send-email-avarab@gmail.com","subject":"Re: [PATCH] test-lib: make test_expect_code a test command","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2010-10-01T17:39:11Z","receivedAt":"2010-10-01T17:39:11Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Fri, Oct 1, 2010 at 19:16, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:\n> converted that code to use an external test similar no the TODO test I\n\ns/no/to/\n> +cat >expect <<EOF &&\n> +not ok - 1 tests clean up even after a failure\n> +#\n> +#          touch clean-after-failure &&\n> +#          test_when_finished rm clean-after-failure &&\n> +#          (exit 1)\n> +#\n> +not ok - 2 failure to clean up causes the test to fail\n> +#\n> +#          test_when_finished \\\"(exit 2)\\\"\n> +#\n> +# failed 2 among 2 test(s)\n> +1..2\n> +EOF\n> +    test_cmp expect out)\n\nI still like the putting-the-code-in-a-separate-harness, but I'm\nwondering if we can't come up with something better than comparing\nwith test output that could change in the future... unless we decide\nto standardize on TAP and not deviate from it? Either case, wouldn't\nit at least be a good idea to get rid of the parts after the # in the\ncomparrison?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"152249","messageId":"1285954940-4247-1-git-send-email-avarab@gmail.com","threadId":"25253","inReplyTo":"1285953391-29840-1-git-send-email-avarab@gmail.com","subject":"[PATCH v2] test-lib: make test_expect_code a test command","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-10-01T17:42:20Z","receivedAt":"2010-10-01T17:42:20Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change 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 to the TODO test I\nadded in v1.7.3-rc0~2^2~3.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n\nFixed s/no the/to the/ typo in the commit message spotted by Sverre\nRabbelier.\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.159.g610493\n"},{"id":"152251","messageId":"AANLkTimUe39Z1Ce2NbfsJUyXe0-mY_CcmMmgk+kO_1a8@mail.gmail.com","threadId":"25253","inReplyTo":"AANLkTim1_Zfbrt4G_S2hj1zfF0VX-fM1AkwFyPp0B1qE@mail.gmail.com","subject":"Re: [PATCH] test-lib: make test_expect_code a test command","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-10-01T17:46:19Z","receivedAt":"2010-10-01T17:46:19Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Oct 1, 2010 at 17:39, Sverre Rabbelier <srabbelier@gmail.com> wrote:\n> Heya,\n>\n> On Fri, Oct 1, 2010 at 19:16, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:\n>> converted that code to use an external test similar no the TODO test I\n>\n> s/no/to/\n\nThanks, fixed.\n\n>> +cat >expect <<EOF &&\n>> +not ok - 1 tests clean up even after a failure\n>> +#\n>> +#          touch clean-after-failure &&\n>> +#          test_when_finished rm clean-after-failure &&\n>> +#          (exit 1)\n>> +#\n>> +not ok - 2 failure to clean up causes the test to fail\n>> +#\n>> +#          test_when_finished \\\"(exit 2)\\\"\n>> +#\n>> +# failed 2 among 2 test(s)\n>> +1..2\n>> +EOF\n>> +    test_cmp expect out)\n>\n> I still like the putting-the-code-in-a-separate-harness, but I'm\n> wondering if we can't come up with something better than comparing\n> with test output that could change in the future... unless we decide\n> to standardize on TAP and not deviate from it?\n\nSince t0000-basic.sh is the sanity test for the test-lib.sh itself\nhaving at least some comparison of output is a good thing. It's a nice\nsanity check in case something ends up changing it.\n\nIt's easy to change it if we change the output, but at least we'll be\ntesting for it explicitly.\n\n> Either case, wouldn't it at least be a good idea to get rid of the\n> parts after the # in the comparrison?\n\nI thought it was simplest to just compare the complete output.\n"},{"id":"152252","messageId":"AANLkTi=geGrRM6kaQ2HqCJBvQTP=rv6LL=N0EQ6zq3FK@mail.gmail.com","threadId":"25253","inReplyTo":"AANLkTimUe39Z1Ce2NbfsJUyXe0-mY_CcmMmgk+kO_1a8@mail.gmail.com","subject":"Re: [PATCH] test-lib: make test_expect_code a test command","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2010-10-01T17:47:36Z","receivedAt":"2010-10-01T17:47:36Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Fri, Oct 1, 2010 at 19:46, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:\n> Since t0000-basic.sh is the sanity test for the test-lib.sh itself\n> having at least some comparison of output is a good thing. It's a nice\n> sanity check in case something ends up changing it.\n>\n> It's easy to change it if we change the output, but at least we'll be\n> testing for it explicitly.\n>\n>> Either case, wouldn't it at least be a good idea to get rid of the\n>> parts after the # in the comparrison?\n>\n> I thought it was simplest to just compare the complete output.\n\nOk, sounds good :)\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"152257","messageId":"20101001185554.GB18692@burratino","threadId":"25253","inReplyTo":"1285953391-29840-1-git-send-email-avarab@gmail.com","subject":"Re: [PATCH] test-lib: make test_expect_code a test command","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-01T18:55:54Z","receivedAt":"2010-10-01T18:55:54Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> Change test_expect_code to be a normal test command instead of a\n> top-level command.\n\nI like it.  New code that uses test_expect_code in the old sense\nwould be easily caught because the title description tends not\nto be the name of a command.\n\nThanks for making the test suite a little saner.\n"},{"id":"152299","messageId":"AANLkTi=oyCFLYuBa6CPCC4PpDt6aPe1wXz98M_F+qary@mail.gmail.com","threadId":"25253","inReplyTo":"20101001104823.GD6816@burratino","subject":"Re: [PATCHv4 06/15] t3600 (rm): add lots of missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T02:47:31Z","receivedAt":"2010-10-03T02:47:31Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Fri, Oct 1, 2010 at 4:48 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Elijah Newren wrote:\n>\n>> Also delete unnecessary, failing code and add some test_when_finished\n>> calls to make sure tests clean up after themselves.\n>\n> I don't understand this one.\n>\n> If tests clean up after themselves, each will restore some pristine\n> state as though (at least as far as the other tests care) it had never\n> run at all, right?\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 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> Before this runs: foo is empty, absent from index.\n> After it runs: foo has content, still absent from index.\n> Requires: nothing.\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>> +     test_when_finished \"git checkout HEAD -- foo\" &&\n>>       git rm --cached foo'\n>\n> Before this runs: foo has content, absent from index.\n> After this runs (without patch): foo has other content, absent from index.\n> After this runs (with patch): foo has content, matching index.\n> Requires: nothing.\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>> +     echo \"other content\" > foo &&\n>> +     git add foo &&\n>> +     echo \"yet another content\" > foo &&\n>> +     test_when_finished \"git checkout HEAD -- foo\" &&\n>>       test_must_fail git rm --cached foo\n>>  '\n>\n> Before this runs: see above.\n> After this runs (without patch): foo has yet another content, absent from index.\n> After this runs (with patch): foo has content, matching index.\n> Requires (without patch): nothing.\n> Requires (with patch): HEAD:foo is content.\n>\n> [etc]\n>\n> So if I understand correctly, this sacrifices the ability to\n> skip individual tests.  What does one gain in return?\n\nGood eye.  It does remove failing code and add correct && chaining,\nbut yes, it will fail if you skip sufficiently many individual tests.\nI believe my original patch submission\n(http://article.gmane.org/gmane.comp.version-control.git/157080) does\nnot suffer from this same problem.  Should I revert to it?\n\nElijah\n"},{"id":"152300","messageId":"AANLkTikmf7NSC+ZDRr3tyK=6NdJnWPaE2KLRdZAJu1a-@mail.gmail.com","threadId":"25253","inReplyTo":"7v4od8nzl9.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCHv4 07/15] t4019 (diff-wserror): add lots of missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T03:03:43Z","receivedAt":"2010-10-03T03:03:43Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Hi,\n\nOn Wed, Sep 29, 2010 at 1:01 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> Also add a test_might_fail in front of the final git_config --unset\n>> core.whitespace as that value may have already been unset previously.\n>\n> In general, if a previous one that is designed to set a variable failed\n> for whatever reason, the next one that does --unset without might-fail\n> will be broken.  So...\n>\n[...]\n>> +     git config --unset core.whitespace &&\n>\n> ... I think you need might-fail in front of this one, and ...\n[...]\n>\n>> +     echo \"F whitespace=-space\" >.gitattributes &&\n>> +     prepare_output &&\n>>\n>>       grep Eight normal >/dev/null &&\n>>       grep 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>> -     rm -f .gitattributes\n>> -     git config core.whitespace indent,-trailing,-space\n>> -     prepare_output\n>> +     rm -f .gitattributes &&\n>> +     git config core.whitespace indent,-trailing,-space &&\n>\n> ... this one, ...\n\nI fixed the others you pointed out, but elsewhere you were talking\nabout git config --unset and the --unset option is not being used\nhere.  Is there another reason this config command needs one?\n"},{"id":"152301","messageId":"AANLkTim5QE8Ze8BQd+dES86FxPx9nJNObU1d7YLF29xN@mail.gmail.com","threadId":"25253","inReplyTo":"20101001113412.GH6816@burratino","subject":"Re: [PATCHv4 09/15] t5602 (clone-remote-exec): add missing &&","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-10-03T03:08:58Z","receivedAt":"2010-10-03T03:08:58Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Fri, Oct 1, 2010 at 5:34 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Junio C Hamano wrote:\n>> Elijah Newren <newren@gmail.com> writes:\n>\n>>> +    GIT_SSH=./not_ssh test_must_fail git clone localhost:/path/to/repo junk &&\n>>\n>> I think this suffers from the same issue that have been fixed with 09b78bc\n>> (t7502-commit.sh: rearrange test to make more portable, 2008-07-22) and\n>> 2d60615 (tests: Avoid single-shot environment export for shell function\n>> invocation, 2009-01-26).\n>\n> Here's a patch for squashing.\n>\n> Thanks again.\n\nThanks for all the reviews and help.  Sorry I've been so slow to\nrespond; it's been a busy week.\n"}]}