{"thread":{"id":"49165","subject":"[PATCH 0/4] tests: make more use of 'test_must_be_empty'","startedAt":"2018-08-19T21:57:44Z","lastAt":"2018-08-22T17:52:06Z","messageCount":6,"participants":["SZEDER Gábor","Matthew DeVore"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"356062","messageId":"20180819215725.29001-1-szeder.dev@gmail.com","threadId":"49165","inReplyTo":null,"subject":"[PATCH 0/4] tests: make more use of 'test_must_be_empty'","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2018-08-19T21:57:21Z","receivedAt":"2018-08-19T21:57:44Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"This series is a continuation of and applies on top of\n'ab/test-must-be-empty-for-master', and converts even more places to\nuse 'test_must_be_empty'.\n\nThere are still a bunch of cases in the form of 'test -z \"$(cmd...)\"'\nthat could use 'test_must_be_empty'...  maybe someday.\n\nSZEDER Gábor (4):\n  tests: use 'test_must_be_empty' instead of '! test -s'\n  tests: use 'test_must_be_empty' instead of 'test ! -s'\n  tests: use 'test_must_be_empty' instead of 'test_cmp /dev/null <out>'\n  tests: use 'test_must_be_empty' instead of 'test_cmp <empty> <out>'\n\n t/t0000-basic.sh                             |  2 +-\n t/t0001-init.sh                              |  5 +--\n t/t0003-attributes.sh                        |  3 +-\n t/t0030-stripspace.sh                        | 22 ++++------\n t/t0040-parse-options.sh                     |  4 +-\n t/t0061-run-command.sh                       |  9 ++--\n t/t0090-cache-tree.sh                        |  2 +-\n t/t0203-gettext-setlocale-sanity.sh          |  4 +-\n t/t1300-config.sh                            |  5 +--\n t/t1410-reflog.sh                            |  3 +-\n t/t1411-reflog-show.sh                       |  3 +-\n t/t1450-fsck.sh                              | 11 +++--\n t/t1501-work-tree.sh                         |  2 +-\n t/t1510-repo-setup.sh                        | 24 +++++------\n t/t1600-index.sh                             |  3 +-\n t/t1700-split-index.sh                       |  4 +-\n t/t2013-checkout-submodule.sh                |  6 +--\n t/t2200-add-update.sh                        |  3 +-\n t/t2203-add-intent.sh                        |  6 +--\n t/t2204-add-ignored.sh                       |  8 ++--\n t/t3001-ls-files-others-exclude.sh           |  6 +--\n t/t3004-ls-files-basic.sh                    |  6 +--\n t/t3035-merge-sparse.sh                      |  5 +--\n t/t3210-pack-refs.sh                         |  6 +--\n t/t3301-notes.sh                             |  4 +-\n t/t3308-notes-merge.sh                       |  2 +-\n t/t3310-notes-merge-manual-resolve.sh        |  8 ++--\n t/t3404-rebase-interactive.sh                |  5 +--\n t/t3600-rm.sh                                |  6 +--\n t/t4011-diff-symlink.sh                      |  2 +-\n t/t4015-diff-whitespace.sh                   |  4 +-\n t/t4019-diff-wserror.sh                      |  2 +-\n t/t4027-diff-submodule.sh                    | 29 ++++++-------\n t/t4041-diff-submodule-option.sh             | 18 ++++----\n t/t4047-diff-dirstat.sh                      |  4 +-\n t/t4060-diff-submodule-option-diff-format.sh | 18 ++++----\n t/t4116-apply-reverse.sh                     |  2 +-\n t/t4124-apply-ws-rule.sh                     |  2 +-\n t/t4132-apply-removal.sh                     |  5 +--\n t/t4150-am.sh                                |  4 +-\n t/t4201-shortlog.sh                          |  2 +-\n t/t4203-mailmap.sh                           |  4 +-\n t/t4211-line-log.sh                          |  2 +-\n t/t4212-log-corrupt.sh                       |  6 +--\n t/t4300-merge-tree.sh                        | 34 +++------------\n t/t5304-prune.sh                             |  3 +-\n t/t5314-pack-cycle-detection.sh              |  3 +-\n t/t5401-update-hooks.sh                      | 10 ++---\n t/t5500-fetch-pack.sh                        |  2 +-\n t/t5509-fetch-push-namespaces.sh             |  2 +-\n t/t5523-push-upstream.sh                     |  2 +-\n t/t5526-fetch-submodules.sh                  | 45 ++++++++++----------\n t/t5541-http-push-smart.sh                   |  2 +-\n t/t5570-git-daemon.sh                        |  2 +-\n t/t6112-rev-list-filters-objects.sh          |  3 +-\n t/t6120-describe.sh                          |  3 +-\n t/t6130-pathspec-noglob.sh                   |  9 ++--\n t/t6200-fmt-merge-msg.sh                     |  4 +-\n t/t7001-mv.sh                                |  6 +--\n t/t7004-tag.sh                               |  8 +---\n t/t7008-grep-binary.sh                       |  6 +--\n t/t7064-wtstatus-pv2.sh                      |  5 +--\n t/t7201-co.sh                                |  7 ++-\n t/t7400-submodule-basic.sh                   | 28 ++++--------\n t/t7401-submodule-summary.sh                 |  2 +-\n t/t7406-submodule-update.sh                  |  2 +-\n t/t7501-commit.sh                            |  6 +--\n t/t7600-merge.sh                             |  9 ++--\n t/t7610-mergetool.sh                         |  3 +-\n t/t7810-grep.sh                              | 35 ++++++---------\n t/t7811-grep-open.sh                         | 18 +++-----\n t/t8010-cat-file-filters.sh                  |  2 +-\n t/t9011-svn-da.sh                            | 14 +++---\n t/t9131-git-svn-empty-symlink.sh             |  6 +--\n t/t9135-git-svn-moved-branch-empty-file.sh   |  3 +-\n t/t9200-git-cvsexportcommit.sh               |  4 +-\n t/t9802-git-p4-filetype.sh                   |  2 +-\n t/t9903-bash-prompt.sh                       |  6 +--\n 78 files changed, 232 insertions(+), 345 deletions(-)\n\n-- \n2.18.0.903.gab616d7dc6\n\n"},{"id":"356063","messageId":"20180819215725.29001-3-szeder.dev@gmail.com","threadId":"49165","inReplyTo":"20180819215725.29001-1-szeder.dev@gmail.com","subject":"[PATCH 2/4] tests: use 'test_must_be_empty' instead of 'test ! -s'","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2018-08-19T21:57:23Z","receivedAt":"2018-08-19T21:57:46Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Using 'test_must_be_empty' is preferable to 'test ! -s', because it\ngives a helpful error message if the given file is unexpectedly no\nempty, while the latter remains completely silent.  Furthermore, it\nalso catches cases when the given file unexpectedly does not exist at\nall.\n\nThis patch was created by:\n\n  sed -i -e 's/test ! -s/test_must_be_empty/' t[0-9]*.sh\n\nSigned-off-by: SZEDER Gábor <szeder.dev@gmail.com>\n---\n t/t4201-shortlog.sh         | 2 +-\n t/t4211-line-log.sh         | 2 +-\n t/t8010-cat-file-filters.sh | 2 +-\n t/t9802-git-p4-filetype.sh  | 2 +-\n 4 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh\nindex 58c2773676..d3a7ce6bbb 100755\n--- a/t/t4201-shortlog.sh\n+++ b/t/t4201-shortlog.sh\n@@ -192,7 +192,7 @@ test_expect_success 'shortlog with revision pseudo options' '\n \n test_expect_success 'shortlog with --output=<file>' '\n \tgit shortlog --output=shortlog -1 master >output &&\n-\ttest ! -s output &&\n+\ttest_must_be_empty output &&\n \ttest_line_count = 3 shortlog\n '\n \ndiff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh\nindex d0377fae5c..6e378b23c7 100755\n--- a/t/t4211-line-log.sh\n+++ b/t/t4211-line-log.sh\n@@ -102,7 +102,7 @@ test_expect_success '-L with --first-parent and a merge' '\n test_expect_success '-L with --output' '\n \tgit checkout parallel-change &&\n \tgit log --output=log -L :main:b.c >output &&\n-\ttest ! -s output &&\n+\ttest_must_be_empty output &&\n \ttest_line_count = 70 log\n '\n \ndiff --git a/t/t8010-cat-file-filters.sh b/t/t8010-cat-file-filters.sh\nindex 0f86c19174..31de4b64dc 100755\n--- a/t/t8010-cat-file-filters.sh\n+++ b/t/t8010-cat-file-filters.sh\n@@ -47,7 +47,7 @@ test_expect_success 'cat-file --textconv --path=<path> works' '\n test_expect_success '--path=<path> complains without --textconv/--filters' '\n \tsha1=$(git rev-parse -q --verify HEAD:world.txt) &&\n \ttest_must_fail git cat-file --path=hello.txt blob $sha1 >actual 2>err &&\n-\ttest ! -s actual &&\n+\ttest_must_be_empty actual &&\n \tgrep \"path.*needs.*filters\" err\n '\n \ndiff --git a/t/t9802-git-p4-filetype.sh b/t/t9802-git-p4-filetype.sh\nindex 1fc9b33aeb..9978352d78 100755\n--- a/t/t9802-git-p4-filetype.sh\n+++ b/t/t9802-git-p4-filetype.sh\n@@ -310,7 +310,7 @@ test_expect_success SYMLINKS 'empty symlink target' '\n \t\t# p4 to sync here will make it generate errors.\n \t\tcd \"$cli\" &&\n \t\tp4 print -q //depot/empty-symlink#2 >out &&\n-\t\ttest ! -s out\n+\t\ttest_must_be_empty out\n \t) &&\n \ttest_when_finished cleanup_git &&\n \n-- \n2.18.0.903.gab616d7dc6\n\n"},{"id":"356064","messageId":"20180819215725.29001-2-szeder.dev@gmail.com","threadId":"49165","inReplyTo":"20180819215725.29001-1-szeder.dev@gmail.com","subject":"[PATCH 1/4] tests: use 'test_must_be_empty' instead of '! test -s'","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2018-08-19T21:57:22Z","receivedAt":"2018-08-19T21:57:48Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Using 'test_must_be_empty' is preferable to '! test -s', because it\ngives a helpful error message if the given file is unexpectedly not\nempty, while the latter remains completely silent.  Furthermore, it\nalso catches cases when the given file unexpectedly does not exist at\nall.\n\nThis patch was basically created by:\n\n  sed -i -e 's/! test -s/test_must_be_empty/' t[0-9]*.sh\n\nwith the following notable exceptions:\n\n  - The '! test -s' check in '.gitmodules ignore=dirty suppresses\n    submodules with untracked content' in 't7508-status.sh' is left\n    as-is, because it's bogus and, therefore, it's subject of a\n    dedicated patch.\n\n  - The '! test -s' checks in 't9131-git-svn-empty-symlink.sh' and\n    't9135-git-svn-moved-branch-empty-file.sh' are immediately\n    preceeded by a 'test -f' to ensure that the files exist in the\n    first place.  'test_must_be_empty' ensures that as well, so those\n    'test -f' commands are removed as well.\n\nSigned-off-by: SZEDER Gábor <szeder.dev@gmail.com>\n---\n\nThat dedicated patch to t7508 can be found at:\n\n  https://public-inbox.org/git/20180818175606.24108-1-szeder.dev@gmail.com/\n\n t/t0000-basic.sh                             |  2 +-\n t/t0090-cache-tree.sh                        |  2 +-\n t/t0203-gettext-setlocale-sanity.sh          |  4 +-\n t/t1501-work-tree.sh                         |  2 +-\n t/t1510-repo-setup.sh                        | 24 +++++------\n t/t2013-checkout-submodule.sh                |  6 +--\n t/t2204-add-ignored.sh                       |  8 ++--\n t/t3600-rm.sh                                |  6 +--\n t/t4011-diff-symlink.sh                      |  2 +-\n t/t4019-diff-wserror.sh                      |  2 +-\n t/t4027-diff-submodule.sh                    | 26 ++++++------\n t/t4041-diff-submodule-option.sh             | 14 +++----\n t/t4060-diff-submodule-option-diff-format.sh | 14 +++----\n t/t4124-apply-ws-rule.sh                     |  2 +-\n t/t4150-am.sh                                |  4 +-\n t/t5401-update-hooks.sh                      | 10 ++---\n t/t5500-fetch-pack.sh                        |  2 +-\n t/t5526-fetch-submodules.sh                  | 42 ++++++++++----------\n t/t5570-git-daemon.sh                        |  2 +-\n t/t7001-mv.sh                                |  6 +--\n t/t7201-co.sh                                |  4 +-\n t/t7406-submodule-update.sh                  |  2 +-\n t/t7810-grep.sh                              |  2 +-\n t/t9131-git-svn-empty-symlink.sh             |  6 +--\n t/t9135-git-svn-moved-branch-empty-file.sh   |  3 +-\n 25 files changed, 98 insertions(+), 99 deletions(-)\n\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex af61d083b4..4e588eda09 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -116,7 +116,7 @@ check_sub_test_lib_test () {\n \tname=\"$1\" # stdin is the expected output from the test\n \t(\n \t\tcd \"$name\" &&\n-\t\t! test -s err &&\n+\t\ttest_must_be_empty err &&\n \t\tsed -e 's/^> //' -e 's/Z$//' >expect &&\n \t\ttest_cmp expect out\n \t)\ndiff --git a/t/t0090-cache-tree.sh b/t/t0090-cache-tree.sh\nindex 0c61268fd2..9e88a56d61 100755\n--- a/t/t0090-cache-tree.sh\n+++ b/t/t0090-cache-tree.sh\n@@ -239,7 +239,7 @@ test_expect_success 'no phantom error when switching trees' '\n \t>newdir/one &&\n \tgit add newdir/one &&\n \tgit checkout 2>errors &&\n-\t! test -s errors\n+\ttest_must_be_empty errors\n '\n \n test_expect_success 'switching trees does not invalidate shared index' '\ndiff --git a/t/t0203-gettext-setlocale-sanity.sh b/t/t0203-gettext-setlocale-sanity.sh\nindex 71b0d74b4d..0ce1f22eff 100755\n--- a/t/t0203-gettext-setlocale-sanity.sh\n+++ b/t/t0203-gettext-setlocale-sanity.sh\n@@ -11,7 +11,7 @@ test_expect_success 'git show a ISO-8859-1 commit under C locale' '\n \t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \ttest_commit \"iso-c-commit\" iso-under-c &&\n \tgit show >out 2>err &&\n-\t! test -s err &&\n+\ttest_must_be_empty err &&\n \tgrep -q \"iso-c-commit\" out\n '\n \n@@ -19,7 +19,7 @@ test_expect_success GETTEXT_LOCALE 'git show a ISO-8859-1 commit under a UTF-8 l\n \t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \ttest_commit \"iso-utf8-commit\" iso-under-utf8 &&\n \tLANGUAGE=is LC_ALL=\"$is_IS_locale\" git show >out 2>err &&\n-\t! test -s err &&\n+\ttest_must_be_empty err &&\n \tgrep -q \"iso-utf8-commit\" out\n '\n \ndiff --git a/t/t1501-work-tree.sh b/t/t1501-work-tree.sh\nindex afcdfafe45..3498d3d55e 100755\n--- a/t/t1501-work-tree.sh\n+++ b/t/t1501-work-tree.sh\n@@ -41,7 +41,7 @@ test_expect_success 'setup: helper for testing rev-parse' '\n \t\t\t# rev-parse --show-prefix should output\n \t\t\t# a single newline when at the top of the work tree,\n \t\t\t# but we test for that separately.\n-\t\t\ttest -z \"$4\" && ! test -s actual.prefix ||\n+\t\t\ttest -z \"$4\" && test_must_be_empty actual.prefix ||\n \t\t\ttest_cmp expected.prefix actual.prefix\n \t\tfi\n \t}\ndiff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh\nindex 972bd9c785..9974457f56 100755\n--- a/t/t1510-repo-setup.sh\n+++ b/t/t1510-repo-setup.sh\n@@ -234,14 +234,14 @@ test_expect_success '#0: nonbare repo, no explicit configuration' '\n \ttry_repo 0 unset unset unset \"\" unset \\\n \t\t.git \"$here/0\" \"$here/0\" \"(null)\" \\\n \t\t.git \"$here/0\" \"$here/0\" sub/ 2>message &&\n-\t! test -s message\n+\ttest_must_be_empty message\n '\n \n test_expect_success '#1: GIT_WORK_TREE without explicit GIT_DIR is accepted' '\n \ttry_repo 1 \"$here\" unset unset \"\" unset \\\n \t\t\"$here/1/.git\" \"$here\" \"$here\" 1/ \\\n \t\t\"$here/1/.git\" \"$here\" \"$here\" 1/sub/ 2>message &&\n-\t! test -s message\n+\ttest_must_be_empty message\n '\n \n test_expect_success '#2: worktree defaults to cwd with explicit GIT_DIR' '\n@@ -268,7 +268,7 @@ test_expect_success '#4: core.worktree without GIT_DIR set is accepted' '\n \ttry_case 4 unset unset \\\n \t\t.git \"$here/4/sub\" \"$here/4\" \"(null)\" \\\n \t\t\"$here/4/.git\" \"$here/4/sub\" \"$here/4/sub\" \"(null)\" 2>message &&\n-\t! test -s message\n+\ttest_must_be_empty message\n '\n \n test_expect_success '#5: core.worktree + GIT_WORK_TREE is accepted' '\n@@ -279,7 +279,7 @@ test_expect_success '#5: core.worktree + GIT_WORK_TREE is accepted' '\n \ttry_repo 5a .. unset \"$here/5a\" \"\" unset \\\n \t\t\"$here/5a/.git\" \"$here\" \"$here\" 5a/ \\\n \t\t\"$here/5a/.git\" \"$here/5a\" \"$here/5a\" sub/ &&\n-\t! test -s message\n+\ttest_must_be_empty message\n '\n \n test_expect_success '#6: setting GIT_DIR brings core.worktree to life' '\n@@ -376,7 +376,7 @@ test_expect_success '#9: GIT_WORK_TREE accepted with gitfile' '\n \ttry_repo 9 wt unset unset gitfile unset \\\n \t\t\"$here/9.git\" \"$here/9/wt\" \"$here/9\" \"(null)\" \\\n \t\t\"$here/9.git\" \"$here/9/sub/wt\" \"$here/9/sub\" \"(null)\" 2>message &&\n-\t! test -s message\n+\ttest_must_be_empty message\n '\n \n test_expect_success '#10: GIT_DIR can point to gitfile' '\n@@ -402,7 +402,7 @@ test_expect_success '#12: core.worktree with gitfile is accepted' '\n \ttry_repo 12 unset unset \"$here/12\" gitfile unset \\\n \t\t\"$here/12.git\" \"$here/12\" \"$here/12\" \"(null)\" \\\n \t\t\"$here/12.git\" \"$here/12\" \"$here/12\" sub/ 2>message &&\n-\t! test -s message\n+\ttest_must_be_empty message\n '\n \n test_expect_success '#13: core.worktree+GIT_WORK_TREE accepted (with gitfile)' '\n@@ -410,7 +410,7 @@ test_expect_success '#13: core.worktree+GIT_WORK_TREE accepted (with gitfile)' '\n \ttry_repo 13 non-existent-too unset non-existent gitfile unset \\\n \t\t\"$here/13.git\" \"$here/13/non-existent-too\" \"$here/13\" \"(null)\" \\\n \t\t\"$here/13.git\" \"$here/13/sub/non-existent-too\" \"$here/13/sub\" \"(null)\" 2>message &&\n-\t! test -s message\n+\ttest_must_be_empty message\n '\n \n # case #14.\n@@ -565,7 +565,7 @@ test_expect_success '#17: GIT_WORK_TREE without explicit GIT_DIR is accepted (ba\n \ttry_repo 17c \"$here/17c\" unset unset \"\" true \\\n \t\t.git \"$here/17c\" \"$here/17c\" \"(null)\" \\\n \t\t\"$here/17c/.git\" \"$here/17c\" \"$here/17c\" sub/ 2>message &&\n-\t! test -s message\n+\ttest_must_be_empty message\n '\n \n test_expect_success '#18: bare .git named by GIT_DIR has no worktree' '\n@@ -594,7 +594,7 @@ test_expect_success '#20a: core.worktree without GIT_DIR accepted (inside .git)'\n \t\t\"$here/20a/.git\" \"$here/20a\" \"$here/20a\" .git/wt/ &&\n \ttry_case 20a/.git/wt/sub unset unset \\\n \t\t\"$here/20a/.git\" \"$here/20a\" \"$here/20a\" .git/wt/sub/ &&\n-\t! test -s message\n+\ttest_must_be_empty message\n '\n \n test_expect_success '#20b/c: core.worktree and core.bare conflict' '\n@@ -626,7 +626,7 @@ test_expect_success '#21: setup, core.worktree warns before overriding core.bare\n \t\texport GIT_WORK_TREE &&\n \t\tgit status >/dev/null\n \t) 2>message &&\n-\t! test -s message\n+\ttest_must_be_empty message\n \n '\n run_wt_tests 21\n@@ -742,7 +742,7 @@ test_expect_success '#25: GIT_WORK_TREE accepted if GIT_DIR unset (bare gitfile\n \ttry_repo 25 \"$here/25\" unset unset gitfile true \\\n \t\t\"$here/25.git\" \"$here/25\" \"$here/25\" \"(null)\"  \\\n \t\t\"$here/25.git\" \"$here/25\" \"$here/25\" \"sub/\" 2>message &&\n-\t! test -s message\n+\ttest_must_be_empty message\n '\n \n test_expect_success '#26: bare repo has no worktree (GIT_DIR -> gitfile case)' '\n@@ -780,7 +780,7 @@ test_expect_success '#29: setup' '\n \t\texport GIT_WORK_TREE &&\n \t\tgit status\n \t) 2>message &&\n-\t! test -s message\n+\ttest_must_be_empty message\n '\n run_wt_tests 29 gitfile\n \ndiff --git a/t/t2013-checkout-submodule.sh b/t/t2013-checkout-submodule.sh\nindex 6ef15738e4..8f86b5f4b2 100755\n--- a/t/t2013-checkout-submodule.sh\n+++ b/t/t2013-checkout-submodule.sh\n@@ -44,7 +44,7 @@ test_expect_success '\"checkout <submodule>\" honors diff.ignoreSubmodules' '\n \tgit config diff.ignoreSubmodules dirty &&\n \techo x> submodule/untracked &&\n \tgit checkout HEAD >actual 2>&1 &&\n-\t! test -s actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success '\"checkout <submodule>\" honors submodule.*.ignore from .gitmodules' '\n@@ -52,7 +52,7 @@ test_expect_success '\"checkout <submodule>\" honors submodule.*.ignore from .gitm\n \tgit config -f .gitmodules submodule.submodule.path submodule &&\n \tgit config -f .gitmodules submodule.submodule.ignore untracked &&\n \tgit checkout HEAD >actual 2>&1 &&\n-\t! test -s actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success '\"checkout <submodule>\" honors submodule.*.ignore from .git/config' '\n@@ -60,7 +60,7 @@ test_expect_success '\"checkout <submodule>\" honors submodule.*.ignore from .git/\n \tgit config submodule.submodule.path submodule &&\n \tgit config submodule.submodule.ignore all &&\n \tgit checkout HEAD >actual 2>&1 &&\n-\t! test -s actual\n+\ttest_must_be_empty actual\n '\n \n KNOWN_FAILURE_DIRECTORY_SUBMODULE_CONFLICTS=1\ndiff --git a/t/t2204-add-ignored.sh b/t/t2204-add-ignored.sh\nindex 8340ac2f07..2e07365bbb 100755\n--- a/t/t2204-add-ignored.sh\n+++ b/t/t2204-add-ignored.sh\n@@ -31,7 +31,7 @@ do\n \t\trm -f .git/index &&\n \t\ttest_must_fail git add \"$i\" 2>err &&\n \t\tgit ls-files \"$i\" >out &&\n-\t\t! test -s out\n+\t\ttest_must_be_empty out\n \t'\n \n \ttest_expect_success \"complaints for ignored $i output\" '\n@@ -42,7 +42,7 @@ do\n \t\trm -f .git/index &&\n \t\ttest_must_fail git add \"$i\" file 2>err &&\n \t\tgit ls-files \"$i\" >out &&\n-\t\t! test -s out\n+\t\ttest_must_be_empty out\n \t'\n \ttest_expect_success \"complaints for ignored $i with unignored file output\" '\n \t\ttest_i18ngrep -e \"Use -f if\" err\n@@ -57,7 +57,7 @@ do\n \t\t\tcd dir &&\n \t\t\ttest_must_fail git add \"$i\" 2>err &&\n \t\t\tgit ls-files \"$i\" >out &&\n-\t\t\t! test -s out\n+\t\t\ttest_must_be_empty out\n \t\t)\n \t'\n \n@@ -77,7 +77,7 @@ do\n \t\t\tcd sub &&\n \t\t\ttest_must_fail git add \"$i\" 2>err &&\n \t\t\tgit ls-files \"$i\" >out &&\n-\t\t\t! test -s out\n+\t\t\ttest_must_be_empty out\n \t\t)\n \t'\n \ndiff --git a/t/t3600-rm.sh b/t/t3600-rm.sh\nindex b8fbdefcdc..b178a376c4 100755\n--- a/t/t3600-rm.sh\n+++ b/t/t3600-rm.sh\n@@ -382,7 +382,7 @@ test_expect_success 'rm does not complain when no .gitmodules file is found' '\n \tgit submodule update &&\n \tgit rm .gitmodules &&\n \tgit rm submod >actual 2>actual.err &&\n-\t! test -s actual.err &&\n+\ttest_must_be_empty actual.err &&\n \t! test -d submod &&\n \t! test -f submod/.git &&\n \tgit status -s -uno >actual &&\n@@ -400,7 +400,7 @@ test_expect_success 'rm will error out on a modified .gitmodules file unless sta\n \tgit diff-files --quiet -- submod &&\n \tgit add .gitmodules &&\n \tgit rm submod >actual 2>actual.err &&\n-\t! test -s actual.err &&\n+\ttest_must_be_empty actual.err &&\n \t! test -d submod &&\n \t! test -f submod/.git &&\n \tgit status -s -uno >actual &&\n@@ -694,7 +694,7 @@ test_expect_success 'checking out a commit after submodule removal needs manual\n \ttest_cmp expected actual &&\n \trm -rf submod &&\n \tgit status -s -uno --ignore-submodules=none >actual &&\n-\t! test -s actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'rm of d/f when d has become a non-directory' '\ndiff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh\nindex 108c012a3a..5ae19b987d 100755\n--- a/t/t4011-diff-symlink.sh\n+++ b/t/t4011-diff-symlink.sh\n@@ -126,7 +126,7 @@ test_expect_success SYMLINKS 'diff symlinks with non-existing targets' '\n \tln -s take\\ over brain &&\n \ttest_must_fail git diff --no-index pinky brain >output 2>output.err &&\n \tgrep narf output &&\n-\t! test -s output.err\n+\ttest_must_be_empty output.err\n '\n \n test_expect_success SYMLINKS 'setup symlinks with attributes' '\ndiff --git a/t/t4019-diff-wserror.sh b/t/t4019-diff-wserror.sh\nindex a5019759bc..c6135c7548 100755\n--- a/t/t4019-diff-wserror.sh\n+++ b/t/t4019-diff-wserror.sh\n@@ -260,7 +260,7 @@ test_expect_success 'trailing empty lines (2)' '\n \n \techo \"F -whitespace\" >.gitattributes &&\n \tgit diff --check >output &&\n-\t! test -s output\n+\ttest_must_be_empty output\n \n '\n \ndiff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh\nindex 6304130ad4..e5f9eb7a11 100755\n--- a/t/t4027-diff-submodule.sh\n+++ b/t/t4027-diff-submodule.sh\n@@ -104,19 +104,19 @@ test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match)'\n \texpect_from_to >expect.body $subprev $subprev-dirty &&\n \ttest_cmp expect.body actual.body &&\n \tgit diff --ignore-submodules HEAD >actual2 &&\n-\t! test -s actual2 &&\n+\ttest_must_be_empty actual2 &&\n \tgit diff --ignore-submodules=untracked HEAD >actual3 &&\n \tsed -e \"1,/^@@/d\" actual3 >actual3.body &&\n \texpect_from_to >expect.body $subprev $subprev-dirty &&\n \ttest_cmp expect.body actual3.body &&\n \tgit diff --ignore-submodules=dirty HEAD >actual4 &&\n-\t! test -s actual4\n+\ttest_must_be_empty actual4\n '\n \n test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match) [.gitmodules]' '\n \tgit config diff.ignoreSubmodules dirty &&\n \tgit diff HEAD >actual &&\n-\t! test -s actual &&\n+\ttest_must_be_empty actual &&\n \tgit config --add -f .gitmodules submodule.subname.ignore none &&\n \tgit config --add -f .gitmodules submodule.subname.path sub &&\n \tgit diff HEAD >actual &&\n@@ -126,7 +126,7 @@ test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match)\n \tgit config -f .gitmodules submodule.subname.ignore all &&\n \tgit config -f .gitmodules submodule.subname.path sub &&\n \tgit diff HEAD >actual2 &&\n-\t! test -s actual2 &&\n+\ttest_must_be_empty actual2 &&\n \tgit config -f .gitmodules submodule.subname.ignore untracked &&\n \tgit diff HEAD >actual3 &&\n \tsed -e \"1,/^@@/d\" actual3 >actual3.body &&\n@@ -134,7 +134,7 @@ test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match)\n \ttest_cmp expect.body actual3.body &&\n \tgit config -f .gitmodules submodule.subname.ignore dirty &&\n \tgit diff HEAD >actual4 &&\n-\t! test -s actual4 &&\n+\ttest_must_be_empty actual4 &&\n \tgit config submodule.subname.ignore none &&\n \tgit config submodule.subname.path sub &&\n \tgit diff HEAD >actual &&\n@@ -172,24 +172,24 @@ test_expect_success 'git diff HEAD with dirty submodule (untracked, refs match)'\n \texpect_from_to >expect.body $subprev $subprev-dirty &&\n \ttest_cmp expect.body actual.body &&\n \tgit diff --ignore-submodules=all HEAD >actual2 &&\n-\t! test -s actual2 &&\n+\ttest_must_be_empty actual2 &&\n \tgit diff --ignore-submodules=untracked HEAD >actual3 &&\n-\t! test -s actual3 &&\n+\ttest_must_be_empty actual3 &&\n \tgit diff --ignore-submodules=dirty HEAD >actual4 &&\n-\t! test -s actual4\n+\ttest_must_be_empty actual4\n '\n \n test_expect_success 'git diff HEAD with dirty submodule (untracked, refs match) [.gitmodules]' '\n \tgit config --add -f .gitmodules submodule.subname.ignore all &&\n \tgit config --add -f .gitmodules submodule.subname.path sub &&\n \tgit diff HEAD >actual2 &&\n-\t! test -s actual2 &&\n+\ttest_must_be_empty actual2 &&\n \tgit config -f .gitmodules submodule.subname.ignore untracked &&\n \tgit diff HEAD >actual3 &&\n-\t! test -s actual3 &&\n+\ttest_must_be_empty actual3 &&\n \tgit config -f .gitmodules submodule.subname.ignore dirty &&\n \tgit diff HEAD >actual4 &&\n-\t! test -s actual4 &&\n+\ttest_must_be_empty actual4 &&\n \tgit config submodule.subname.ignore none &&\n \tgit config submodule.subname.path sub &&\n \tgit diff HEAD >actual &&\n@@ -211,7 +211,7 @@ test_expect_success 'git diff between submodule commits' '\n \texpect_from_to >expect.body $subtip $subprev &&\n \ttest_cmp expect.body actual.body &&\n \tgit diff --ignore-submodules HEAD^..HEAD >actual &&\n-\t! test -s actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'git diff between submodule commits [.gitmodules]' '\n@@ -227,7 +227,7 @@ test_expect_success 'git diff between submodule commits [.gitmodules]' '\n \ttest_cmp expect.body actual.body &&\n \tgit config -f .gitmodules submodule.subname.ignore all &&\n \tgit diff HEAD^..HEAD >actual &&\n-\t! test -s actual &&\n+\ttest_must_be_empty actual &&\n \tgit config submodule.subname.ignore dirty &&\n \tgit config submodule.subname.path sub &&\n \tgit diff  HEAD^..HEAD >actual &&\ndiff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh\nindex 058ee0829d..302f2166a9 100755\n--- a/t/t4041-diff-submodule-option.sh\n+++ b/t/t4041-diff-submodule-option.sh\n@@ -273,17 +273,17 @@ test_expect_success 'submodule contains untracked content' '\n \n test_expect_success 'submodule contains untracked content (untracked ignored)' '\n \tgit diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual &&\n-\t! test -s actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'submodule contains untracked content (dirty ignored)' '\n \tgit diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&\n-\t! test -s actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'submodule contains untracked content (all ignored)' '\n \tgit diff-index -p --ignore-submodules=all --submodule=log HEAD >actual &&\n-\t! test -s actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'submodule contains untracked and modifed content' '\n@@ -308,13 +308,13 @@ test_expect_success 'submodule contains untracked and modifed content (untracked\n test_expect_success 'submodule contains untracked and modifed content (dirty ignored)' '\n \techo new > sm1/foo6 &&\n \tgit diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&\n-\t! test -s actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'submodule contains untracked and modifed content (all ignored)' '\n \techo new > sm1/foo6 &&\n \tgit diff-index -p --ignore-submodules --submodule=log HEAD >actual &&\n-\t! test -s actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'submodule contains modifed content' '\n@@ -368,7 +368,7 @@ test_expect_success 'modified submodule contains untracked content (dirty ignore\n \n test_expect_success 'modified submodule contains untracked content (all ignored)' '\n \tgit diff-index -p --ignore-submodules=all --submodule=log HEAD >actual &&\n-\t! test -s actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'modified submodule contains untracked and modifed content' '\n@@ -407,7 +407,7 @@ test_expect_success 'modified submodule contains untracked and modifed content (\n test_expect_success 'modified submodule contains untracked and modifed content (all ignored)' '\n \techo modification >> sm1/foo6 &&\n \tgit diff-index -p --ignore-submodules --submodule=log HEAD >actual &&\n-\t! test -s actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'modified submodule contains modifed content' '\ndiff --git a/t/t4060-diff-submodule-option-diff-format.sh b/t/t4060-diff-submodule-option-diff-format.sh\nindex 4b168d0ed7..6fc3da8bd2 100755\n--- a/t/t4060-diff-submodule-option-diff-format.sh\n+++ b/t/t4060-diff-submodule-option-diff-format.sh\n@@ -408,17 +408,17 @@ test_expect_success 'submodule contains untracked content' '\n \n test_expect_success 'submodule contains untracked content (untracked ignored)' '\n \tgit diff-index -p --ignore-submodules=untracked --submodule=diff HEAD >actual &&\n-\t! test -s actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'submodule contains untracked content (dirty ignored)' '\n \tgit diff-index -p --ignore-submodules=dirty --submodule=diff HEAD >actual &&\n-\t! test -s actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'submodule contains untracked content (all ignored)' '\n \tgit diff-index -p --ignore-submodules=all --submodule=diff HEAD >actual &&\n-\t! test -s actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'submodule contains untracked and modified content' '\n@@ -458,13 +458,13 @@ test_expect_success 'submodule contains untracked and modified content (untracke\n test_expect_success 'submodule contains untracked and modified content (dirty ignored)' '\n \techo new > sm1/foo6 &&\n \tgit diff-index -p --ignore-submodules=dirty --submodule=diff HEAD >actual &&\n-\t! test -s actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'submodule contains untracked and modified content (all ignored)' '\n \techo new > sm1/foo6 &&\n \tgit diff-index -p --ignore-submodules --submodule=diff HEAD >actual &&\n-\t! test -s actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'submodule contains modified content' '\n@@ -549,7 +549,7 @@ test_expect_success 'modified submodule contains untracked content (dirty ignore\n \n test_expect_success 'modified submodule contains untracked content (all ignored)' '\n \tgit diff-index -p --ignore-submodules=all --submodule=diff HEAD >actual &&\n-\t! test -s actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'modified submodule contains untracked and modified content' '\n@@ -609,7 +609,7 @@ test_expect_success 'modified submodule contains untracked and modified content\n test_expect_success 'modified submodule contains untracked and modified content (all ignored)' '\n \techo modification >> sm1/foo6 &&\n \tgit diff-index -p --ignore-submodules --submodule=diff HEAD >actual &&\n-\t! test -s actual\n+\ttest_must_be_empty actual\n '\n \n # NOT OK\ndiff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh\nindex 4fc27c51f7..7e32237a2a 100755\n--- a/t/t4124-apply-ws-rule.sh\n+++ b/t/t4124-apply-ws-rule.sh\n@@ -100,7 +100,7 @@ test_expect_success 'whitespace=warn, default rule' '\n test_expect_success 'whitespace=error-all, default rule' '\n \n \ttest_must_fail apply_patch --whitespace=error-all &&\n-\t! test -s target\n+\ttest_must_be_empty target\n \n '\n \ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex 1ebc587f8f..38fe717c12 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -651,7 +651,7 @@ test_expect_success 'am -3 -q is quiet' '\n \tgit checkout -f lorem2 &&\n \tgit reset base3way --hard &&\n \tgit am -3 -q lorem-move.patch >output.out 2>&1 &&\n-\t! test -s output.out\n+\ttest_must_be_empty output.out\n '\n \n test_expect_success 'am pauses on conflict' '\n@@ -874,7 +874,7 @@ test_expect_success 'am -q is quiet' '\n \tgit checkout first &&\n \ttest_tick &&\n \tgit am -q <patch1 >output.out 2>&1 &&\n-\t! test -s output.out\n+\ttest_must_be_empty output.out\n '\n \n test_expect_success 'am empty-file does not infloop' '\ndiff --git a/t/t5401-update-hooks.sh b/t/t5401-update-hooks.sh\nindex 7f278d8ce9..ce151e71c1 100755\n--- a/t/t5401-update-hooks.sh\n+++ b/t/t5401-update-hooks.sh\n@@ -104,17 +104,17 @@ test_expect_success 'post-update hook arguments' '\n '\n \n test_expect_success 'all hook stdin is /dev/null' '\n-\t! test -s victim.git/update.stdin &&\n-\t! test -s victim.git/post-update.stdin\n+\ttest_must_be_empty victim.git/update.stdin &&\n+\ttest_must_be_empty victim.git/post-update.stdin\n '\n \n test_expect_success 'all *-receive hook args are empty' '\n-\t! test -s victim.git/pre-receive.args &&\n-\t! test -s victim.git/post-receive.args\n+\ttest_must_be_empty victim.git/pre-receive.args &&\n+\ttest_must_be_empty victim.git/post-receive.args\n '\n \n test_expect_success 'send-pack produced no output' '\n-\t! test -s send.out\n+\ttest_must_be_empty send.out\n '\n \n cat <<EOF >expect\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 3d33ab3875..07fcea0474 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -161,7 +161,7 @@ test_expect_success 'clone shallow object count' '\n test_expect_success 'clone shallow object count (part 2)' '\n \tsed -e \"/^in-pack:/d\" -e \"/^packs:/d\" -e \"/^size-pack:/d\" \\\n \t    -e \"/: 0$/d\" count.shallow > count_output &&\n-\t! test -s count_output\n+\ttest_must_be_empty count_output\n '\n \n test_expect_success 'fsck in shallow repo' '\ndiff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh\nindex 359e03ff83..ce3af92843 100755\n--- a/t/t5526-fetch-submodules.sh\n+++ b/t/t5526-fetch-submodules.sh\n@@ -98,8 +98,8 @@ test_expect_success \"fetch alone only fetches superproject\" '\n \t\tcd downstream &&\n \t\tgit fetch >../actual.out 2>../actual.err\n \t) &&\n-\t! test -s actual.out &&\n-\t! test -s actual.err\n+\ttest_must_be_empty actual.out &&\n+\ttest_must_be_empty actual.err\n '\n \n test_expect_success \"fetch --no-recurse-submodules only fetches superproject\" '\n@@ -107,8 +107,8 @@ test_expect_success \"fetch --no-recurse-submodules only fetches superproject\" '\n \t\tcd downstream &&\n \t\tgit fetch --no-recurse-submodules >../actual.out 2>../actual.err\n \t) &&\n-\t! test -s actual.out &&\n-\t! test -s actual.err\n+\ttest_must_be_empty actual.out &&\n+\ttest_must_be_empty actual.err\n '\n \n test_expect_success \"using fetchRecurseSubmodules=true in .gitmodules recurses into submodules\" '\n@@ -127,8 +127,8 @@ test_expect_success \"--no-recurse-submodules overrides .gitmodules config\" '\n \t\tcd downstream &&\n \t\tgit fetch --no-recurse-submodules >../actual.out 2>../actual.err\n \t) &&\n-\t! test -s actual.out &&\n-\t! test -s actual.err\n+\ttest_must_be_empty actual.out &&\n+\ttest_must_be_empty actual.err\n '\n \n test_expect_success \"using fetchRecurseSubmodules=false in .git/config overrides setting in .gitmodules\" '\n@@ -137,8 +137,8 @@ test_expect_success \"using fetchRecurseSubmodules=false in .git/config overrides\n \t\tgit config submodule.submodule.fetchRecurseSubmodules false &&\n \t\tgit fetch >../actual.out 2>../actual.err\n \t) &&\n-\t! test -s actual.out &&\n-\t! test -s actual.err\n+\ttest_must_be_empty actual.out &&\n+\ttest_must_be_empty actual.err\n '\n \n test_expect_success \"--recurse-submodules overrides fetchRecurseSubmodules setting from .git/config\" '\n@@ -157,8 +157,8 @@ test_expect_success \"--quiet propagates to submodules\" '\n \t\tcd downstream &&\n \t\tgit fetch --recurse-submodules --quiet >../actual.out 2>../actual.err\n \t) &&\n-\t! test -s actual.out &&\n-\t! test -s actual.err\n+\ttest_must_be_empty actual.out &&\n+\ttest_must_be_empty actual.err\n '\n \n test_expect_success \"--quiet propagates to parallel submodules\" '\n@@ -166,8 +166,8 @@ test_expect_success \"--quiet propagates to parallel submodules\" '\n \t\tcd downstream &&\n \t\tgit fetch --recurse-submodules -j 2 --quiet  >../actual.out 2>../actual.err\n \t) &&\n-\t! test -s actual.out &&\n-\t! test -s actual.err\n+\ttest_must_be_empty actual.out &&\n+\ttest_must_be_empty actual.err\n '\n \n test_expect_success \"--dry-run propagates to submodules\" '\n@@ -221,8 +221,8 @@ test_expect_success \"--no-recurse-submodules overrides config setting\" '\n \t\tgit config fetch.recurseSubmodules true &&\n \t\tgit fetch --no-recurse-submodules >../actual.out 2>../actual.err\n \t) &&\n-\t! test -s actual.out &&\n-\t! test -s actual.err\n+\ttest_must_be_empty actual.out &&\n+\ttest_must_be_empty actual.err\n '\n \n test_expect_success \"Recursion doesn't happen when no new commits are fetched in the superproject\" '\n@@ -235,8 +235,8 @@ test_expect_success \"Recursion doesn't happen when no new commits are fetched in\n \t\tgit config --unset fetch.recurseSubmodules &&\n \t\tgit fetch >../actual.out 2>../actual.err\n \t) &&\n-\t! test -s actual.out &&\n-\t! test -s actual.err\n+\ttest_must_be_empty actual.out &&\n+\ttest_must_be_empty actual.err\n '\n \n test_expect_success \"Recursion stops when no new submodule commits are fetched\" '\n@@ -268,7 +268,7 @@ test_expect_success \"Recursion doesn't happen when new superproject commits don'\n \t\tcd downstream &&\n \t\tgit fetch >../actual.out 2>../actual.err\n \t) &&\n-\t! test -s actual.out &&\n+\ttest_must_be_empty actual.out &&\n \ttest_i18ncmp expect.err.file actual.err\n '\n \n@@ -357,8 +357,8 @@ test_expect_success \"'--recurse-submodules=on-demand' doesn't recurse when no ne\n \t\tgit fetch --recurse-submodules=on-demand >../actual.out 2>../actual.err &&\n \t\tgit config --unset fetch.recurseSubmodules\n \t) &&\n-\t! test -s actual.out &&\n-\t! test -s actual.err\n+\ttest_must_be_empty actual.out &&\n+\ttest_must_be_empty actual.err\n '\n \n test_expect_success \"'--recurse-submodules=on-demand' recurses as deep as necessary (and ignores config)\" '\n@@ -402,7 +402,7 @@ test_expect_success \"'--recurse-submodules=on-demand' stops when no new submodul\n \t\tcd downstream &&\n \t\tgit fetch --recurse-submodules=on-demand >../actual.out 2>../actual.err\n \t) &&\n-\t! test -s actual.out &&\n+\ttest_must_be_empty actual.out &&\n \ttest_i18ncmp expect.err.file actual.err\n '\n \n@@ -477,7 +477,7 @@ test_expect_success \"don't fetch submodule when newly recorded commits are alrea\n \t\tcd downstream &&\n \t\tgit fetch >../actual.out 2>../actual.err\n \t) &&\n-\t! test -s actual.out &&\n+\ttest_must_be_empty actual.out &&\n \ttest_i18ncmp expect.err actual.err &&\n \t(\n \t\tcd submodule &&\ndiff --git a/t/t5570-git-daemon.sh b/t/t5570-git-daemon.sh\nindex 0d4c52016b..12c1e43a84 100755\n--- a/t/t5570-git-daemon.sh\n+++ b/t/t5570-git-daemon.sh\n@@ -51,7 +51,7 @@ test_expect_success 'no-op fetch -v stderr is as expected' '\n \n test_expect_success 'no-op fetch without \"-v\" is quiet' '\n \t(cd clone && git fetch 2>../stderr) &&\n-\t! test -s stderr\n+\ttest_must_be_empty stderr\n '\n \n test_expect_success 'remote detects correct HEAD' '\ndiff --git a/t/t7001-mv.sh b/t/t7001-mv.sh\nindex cc3fd2baf2..56ca467c0a 100755\n--- a/t/t7001-mv.sh\n+++ b/t/t7001-mv.sh\n@@ -384,7 +384,7 @@ test_expect_success 'mv does not complain when no .gitmodules file is found' '\n \tentry=\"$(git ls-files --stage sub | cut -f 1)\" &&\n \tmkdir mod &&\n \tgit mv sub mod/sub 2>actual.err &&\n-\t! test -s actual.err &&\n+\ttest_must_be_empty actual.err &&\n \t! test -e sub &&\n \t[ \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" ] &&\n \t(\n@@ -408,7 +408,7 @@ test_expect_success 'mv will error out on a modified .gitmodules file unless sta\n \tgit diff-files --quiet -- sub &&\n \tgit add .gitmodules &&\n \tgit mv sub mod/sub 2>actual.err &&\n-\t! test -s actual.err &&\n+\ttest_must_be_empty actual.err &&\n \t! test -e sub &&\n \t[ \"$entry\" = \"$(git ls-files --stage mod/sub | cut -f 1)\" ] &&\n \t(\n@@ -469,7 +469,7 @@ test_expect_success 'checking out a commit before submodule moved needs manual u\n \tgit update-index --refresh &&\n \tgit diff-files --quiet -- sub .gitmodules &&\n \tgit status -s sub2 >actual &&\n-\t! test -s actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'mv -k does not accidentally destroy submodules' '\ndiff --git a/t/t7201-co.sh b/t/t7201-co.sh\nindex ab9da61da3..0e7d4421a7 100755\n--- a/t/t7201-co.sh\n+++ b/t/t7201-co.sh\n@@ -139,7 +139,7 @@ test_expect_success \"checkout -m with dirty tree, renamed\" '\n \ttest_cmp expect uno &&\n \t! test -f one &&\n \tgit diff --cached >current &&\n-\t! test -s current\n+\ttest_must_be_empty current\n \n '\n \n@@ -163,7 +163,7 @@ test_expect_success 'checkout -m with merge conflict' '\n \tfill d2 aT d7 aS >expect &&\n \ttest_cmp current expect &&\n \tgit diff --cached two >current &&\n-\t! test -s current\n+\ttest_must_be_empty current\n '\n \n test_expect_success 'format of merge conflict from checkout -m' '\ndiff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh\nindex 9e0d31700e..0fef49954f 100755\n--- a/t/t7406-submodule-update.sh\n+++ b/t/t7406-submodule-update.sh\n@@ -174,7 +174,7 @@ test_expect_success 'submodule update does not fetch already present commits' '\n \t  git submodule update > ../actual 2> ../actual.err\n \t) &&\n \ttest_i18ncmp expected actual &&\n-\t! test -s actual.err\n+\ttest_must_be_empty actual.err\n '\n \n test_expect_success 'submodule update should fail due to local changes' '\ndiff --git a/t/t7810-grep.sh b/t/t7810-grep.sh\nindex fc44ec96aa..825da1404a 100755\n--- a/t/t7810-grep.sh\n+++ b/t/t7810-grep.sh\n@@ -941,7 +941,7 @@ test_expect_success 'grep from a subdirectory to search wider area (2)' '\n \t(\n \t\tcd s || exit 1\n \t\t( git grep xxyyzz .. >out ; echo $? >status )\n-\t\t! test -s out &&\n+\t\ttest_must_be_empty out &&\n \t\ttest 1 = $(cat status)\n \t)\n '\ndiff --git a/t/t9131-git-svn-empty-symlink.sh b/t/t9131-git-svn-empty-symlink.sh\nindex f762038f0e..3bf4255aa3 100755\n--- a/t/t9131-git-svn-empty-symlink.sh\n+++ b/t/t9131-git-svn-empty-symlink.sh\n@@ -85,7 +85,7 @@ EOF\n test_expect_success 'clone using git svn' 'git svn clone -r1 \"$svnrepo\" x'\n test_expect_success 'enable broken symlink workaround' \\\n   '(cd x && git config svn.brokenSymlinkWorkaround true)'\n-test_expect_success '\"bar\" is an empty file' 'test -f x/bar && ! test -s x/bar'\n+test_expect_success '\"bar\" is an empty file' 'test_must_be_empty x/bar'\n test_expect_success 'get \"bar\" => symlink fix from svn' \\\n \t\t'(cd x && git svn rebase)'\n test_expect_success SYMLINKS '\"bar\" becomes a symlink' 'test -h x/bar'\n@@ -94,14 +94,14 @@ test_expect_success SYMLINKS '\"bar\" becomes a symlink' 'test -h x/bar'\n test_expect_success 'clone using git svn' 'git svn clone -r1 \"$svnrepo\" y'\n test_expect_success 'disable broken symlink workaround' \\\n   '(cd y && git config svn.brokenSymlinkWorkaround false)'\n-test_expect_success '\"bar\" is an empty file' 'test -f y/bar && ! test -s y/bar'\n+test_expect_success '\"bar\" is an empty file' 'test_must_be_empty y/bar'\n test_expect_success 'get \"bar\" => symlink fix from svn' \\\n \t\t'(cd y && git svn rebase)'\n test_expect_success '\"bar\" does not become a symlink' '! test -L y/bar'\n \n # svn.brokenSymlinkWorkaround is unset\n test_expect_success 'clone using git svn' 'git svn clone -r1 \"$svnrepo\" z'\n-test_expect_success '\"bar\" is an empty file' 'test -f z/bar && ! test -s z/bar'\n+test_expect_success '\"bar\" is an empty file' 'test_must_be_empty z/bar'\n test_expect_success 'get \"bar\" => symlink fix from svn' \\\n \t\t'(cd z && git svn rebase)'\n test_expect_success '\"bar\" does not become a symlink' '! test -L z/bar'\ndiff --git a/t/t9135-git-svn-moved-branch-empty-file.sh b/t/t9135-git-svn-moved-branch-empty-file.sh\nindex 93db45db7d..2f80b216fe 100755\n--- a/t/t9135-git-svn-moved-branch-empty-file.sh\n+++ b/t/t9135-git-svn-moved-branch-empty-file.sh\n@@ -13,8 +13,7 @@ test_expect_success 'test that b1 exists and is empty' '\n \t(\n \t\tcd x &&\n \t\tgit reset --hard origin/branch-c &&\n-\t\ttest -f b1 &&\n-\t\t! test -s b1\n+\t\ttest_must_be_empty b1\n \t)\n \t'\n \n-- \n2.18.0.903.gab616d7dc6\n\n"},{"id":"356065","messageId":"20180819215725.29001-4-szeder.dev@gmail.com","threadId":"49165","inReplyTo":"20180819215725.29001-1-szeder.dev@gmail.com","subject":"[PATCH 3/4] tests: use 'test_must_be_empty' instead of 'test_cmp /dev/null <out>'","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2018-08-19T21:57:24Z","receivedAt":"2018-08-19T21:57:50Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Using 'test_must_be_empty' is more idiomatic than 'test_cmp /dev/null\nout', and its message on error is perhaps a bit more to the point.\n\nThis patch was basically created by running:\n\n  sed -i -e 's%test_cmp /dev/null%test_must_be_empty%' t[0-9]*.sh\n\nwith the exception of the change in 'should not fail in an empty repo'\nin 't7401-submodule-summary.sh', where it was 'test_cmp output\n/dev/null'.\n\nSigned-off-by: SZEDER Gábor <szeder.dev@gmail.com>\n---\n t/t3210-pack-refs.sh                  | 6 +++---\n t/t3308-notes-merge.sh                | 2 +-\n t/t3310-notes-merge-manual-resolve.sh | 8 ++++----\n t/t4047-diff-dirstat.sh               | 4 ++--\n t/t4116-apply-reverse.sh              | 2 +-\n t/t5509-fetch-push-namespaces.sh      | 2 +-\n t/t5523-push-upstream.sh              | 2 +-\n t/t5541-http-push-smart.sh            | 2 +-\n t/t7401-submodule-summary.sh          | 2 +-\n t/t7810-grep.sh                       | 2 +-\n 10 files changed, 16 insertions(+), 16 deletions(-)\n\ndiff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh\nindex afa27ffe2d..112cbb0e62 100755\n--- a/t/t3210-pack-refs.sh\n+++ b/t/t3210-pack-refs.sh\n@@ -127,7 +127,7 @@ test_expect_success 'explicit pack-refs with dangling packed reference' '\n \tgit reflog expire --expire=all --all &&\n \tgit prune --expire=all &&\n \tgit pack-refs --all 2>result &&\n-\ttest_cmp /dev/null result\n+\ttest_must_be_empty result\n '\n \n test_expect_success 'delete ref with dangling packed version' '\n@@ -139,7 +139,7 @@ test_expect_success 'delete ref with dangling packed version' '\n \tgit reflog expire --expire=all --all &&\n \tgit prune --expire=all &&\n \tgit branch -d lamb 2>result &&\n-\ttest_cmp /dev/null result\n+\ttest_must_be_empty result\n '\n \n test_expect_success 'delete ref while another dangling packed ref' '\n@@ -150,7 +150,7 @@ test_expect_success 'delete ref while another dangling packed ref' '\n \tgit reflog expire --expire=all --all &&\n \tgit prune --expire=all &&\n \tgit branch -d lamb 2>result &&\n-\ttest_cmp /dev/null result\n+\ttest_must_be_empty result\n '\n \n test_expect_success 'pack ref directly below refs/' '\ndiff --git a/t/t3308-notes-merge.sh b/t/t3308-notes-merge.sh\nindex ab946a5153..d60588ec8f 100755\n--- a/t/t3308-notes-merge.sh\n+++ b/t/t3308-notes-merge.sh\n@@ -183,7 +183,7 @@ test_expect_success 'merge empty notes ref (z => y)' '\n \tgit notes add -m \"foo\" &&\n \tgit notes remove &&\n \tgit notes >output_notes_z &&\n-\ttest_cmp /dev/null output_notes_z &&\n+\ttest_must_be_empty output_notes_z &&\n \t# Do the merge (z => y)\n \tgit config core.notesRef refs/notes/y &&\n \tgit notes merge z &&\ndiff --git a/t/t3310-notes-merge-manual-resolve.sh b/t/t3310-notes-merge-manual-resolve.sh\nindex 9c1bf6eb3d..a1cf4ec385 100755\n--- a/t/t3310-notes-merge-manual-resolve.sh\n+++ b/t/t3310-notes-merge-manual-resolve.sh\n@@ -337,7 +337,7 @@ EOF\n \tgit notes merge --commit &&\n \t# No .git/NOTES_MERGE_* files left\n \ttest_might_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&\n-\ttest_cmp /dev/null output &&\n+\ttest_must_be_empty output &&\n \t# Merge commit has pre-merge y and pre-merge z as parents\n \ttest \"$(git rev-parse refs/notes/m^1)\" = \"$(cat pre_merge_y)\" &&\n \ttest \"$(git rev-parse refs/notes/m^2)\" = \"$(cat pre_merge_z)\" &&\n@@ -399,7 +399,7 @@ test_expect_success 'abort notes merge' '\n \tgit notes merge --abort &&\n \t# No .git/NOTES_MERGE_* files left\n \ttest_might_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&\n-\ttest_cmp /dev/null output &&\n+\ttest_must_be_empty output &&\n \t# m has not moved (still == y)\n \ttest \"$(git rev-parse refs/notes/m)\" = \"$(cat pre_merge_y)\" &&\n \t# Verify that other notes refs has not changed (w, x, y and z)\n@@ -466,7 +466,7 @@ EOF\n \tgit notes merge --commit &&\n \t# No .git/NOTES_MERGE_* files left\n \ttest_might_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&\n-\ttest_cmp /dev/null output &&\n+\ttest_must_be_empty output &&\n \t# Merge commit has pre-merge y and pre-merge z as parents\n \ttest \"$(git rev-parse refs/notes/m^1)\" = \"$(cat pre_merge_y)\" &&\n \ttest \"$(git rev-parse refs/notes/m^2)\" = \"$(cat pre_merge_z)\" &&\n@@ -555,7 +555,7 @@ test_expect_success 'resolve situation by aborting the notes merge' '\n \tgit notes merge --abort &&\n \t# No .git/NOTES_MERGE_* files left\n \ttest_might_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&\n-\ttest_cmp /dev/null output &&\n+\ttest_must_be_empty output &&\n \t# m has not moved (still == w)\n \ttest \"$(git rev-parse refs/notes/m)\" = \"$(git rev-parse refs/notes/w)\" &&\n \t# Verify that other notes refs has not changed (w, x, y and z)\ndiff --git a/t/t4047-diff-dirstat.sh b/t/t4047-diff-dirstat.sh\nindex 447a8ffa3a..7fec2cb9cd 100755\n--- a/t/t4047-diff-dirstat.sh\n+++ b/t/t4047-diff-dirstat.sh\n@@ -940,7 +940,7 @@ test_expect_success 'diff.dirstat=0,lines' '\n test_expect_success '--dirstat=future_param,lines,0 should fail loudly' '\n \ttest_must_fail git diff --dirstat=future_param,lines,0 HEAD^..HEAD >actual_diff_dirstat 2>actual_error &&\n \ttest_debug \"cat actual_error\" &&\n-\ttest_cmp /dev/null actual_diff_dirstat &&\n+\ttest_must_be_empty actual_diff_dirstat &&\n \ttest_i18ngrep -q \"future_param\" actual_error &&\n \ttest_i18ngrep -q \"\\--dirstat\" actual_error\n '\n@@ -948,7 +948,7 @@ test_expect_success '--dirstat=future_param,lines,0 should fail loudly' '\n test_expect_success '--dirstat=dummy1,cumulative,2dummy should report both unrecognized parameters' '\n \ttest_must_fail git diff --dirstat=dummy1,cumulative,2dummy HEAD^..HEAD >actual_diff_dirstat 2>actual_error &&\n \ttest_debug \"cat actual_error\" &&\n-\ttest_cmp /dev/null actual_diff_dirstat &&\n+\ttest_must_be_empty actual_diff_dirstat &&\n \ttest_i18ngrep -q \"dummy1\" actual_error &&\n \ttest_i18ngrep -q \"2dummy\" actual_error &&\n \ttest_i18ngrep -q \"\\--dirstat\" actual_error\ndiff --git a/t/t4116-apply-reverse.sh b/t/t4116-apply-reverse.sh\nindex ce8567f496..b99e65c086 100755\n--- a/t/t4116-apply-reverse.sh\n+++ b/t/t4116-apply-reverse.sh\n@@ -42,7 +42,7 @@ test_expect_success 'apply in reverse' '\n \tgit reset --hard second &&\n \tgit apply --reverse --binary --index patch &&\n \tgit diff >diff &&\n-\ttest_cmp /dev/null diff\n+\ttest_must_be_empty diff\n \n '\n \ndiff --git a/t/t5509-fetch-push-namespaces.sh b/t/t5509-fetch-push-namespaces.sh\nindex 75c570adca..c88df78c0b 100755\n--- a/t/t5509-fetch-push-namespaces.sh\n+++ b/t/t5509-fetch-push-namespaces.sh\n@@ -44,7 +44,7 @@ test_expect_success 'pushing into a repository using a ref namespace' '\n \t\ttest_cmp expected actual &&\n \t\t# Try a namespace with no content\n \t\tgit ls-remote \"ext::git --namespace=garbage %s ../pushee\" >actual &&\n-\t\ttest_cmp /dev/null actual &&\n+\t\ttest_must_be_empty actual &&\n \t\tgit ls-remote pushee-unnamespaced >actual &&\n \t\tsed -e \"s|refs/|refs/namespaces/namespace/refs/|\" expected >expected.unnamespaced &&\n \t\ttest_cmp expected.unnamespaced actual\ndiff --git a/t/t5523-push-upstream.sh b/t/t5523-push-upstream.sh\nindex d6981ba304..c0df81a014 100755\n--- a/t/t5523-push-upstream.sh\n+++ b/t/t5523-push-upstream.sh\n@@ -113,7 +113,7 @@ test_expect_success TTY 'quiet push' '\n \tensure_fresh_upstream &&\n \n \ttest_terminal git push --quiet --no-progress upstream master 2>&1 | tee output &&\n-\ttest_cmp /dev/null output\n+\ttest_must_be_empty output\n '\n \n test_done\ndiff --git a/t/t5541-http-push-smart.sh b/t/t5541-http-push-smart.sh\nindex a2af693068..4319ef6ec7 100755\n--- a/t/t5541-http-push-smart.sh\n+++ b/t/t5541-http-push-smart.sh\n@@ -226,7 +226,7 @@ test_expect_success TTY 'push --quiet silences status and progress' '\n \tcd \"$ROOT_PATH\"/test_repo_clone &&\n \ttest_commit quiet &&\n \ttest_terminal git push --quiet >output 2>&1 &&\n-\ttest_cmp /dev/null output\n+\ttest_must_be_empty output\n '\n \n test_expect_success TTY 'push --no-progress silences progress but not status' '\ndiff --git a/t/t7401-submodule-summary.sh b/t/t7401-submodule-summary.sh\nindex 1cd12b38c5..9bc841d085 100755\n--- a/t/t7401-submodule-summary.sh\n+++ b/t/t7401-submodule-summary.sh\n@@ -300,7 +300,7 @@ test_expect_success 'should not fail in an empty repo' \"\n \tgit init xyzzy &&\n \tcd xyzzy &&\n \tgit submodule summary >output 2>&1 &&\n-\ttest_cmp output /dev/null\n+\ttest_must_be_empty output\n \"\n \n test_done\ndiff --git a/t/t7810-grep.sh b/t/t7810-grep.sh\nindex 825da1404a..42d5354c2a 100755\n--- a/t/t7810-grep.sh\n+++ b/t/t7810-grep.sh\n@@ -483,7 +483,7 @@ test_expect_success 'grep -L -C' '\n \n test_expect_success 'grep --files-without-match --quiet' '\n \tgit grep --files-without-match --quiet nonexistent_string >actual &&\n-\ttest_cmp /dev/null actual\n+\ttest_must_be_empty actual\n '\n \n cat >expected <<EOF\n-- \n2.18.0.903.gab616d7dc6\n\n"},{"id":"356066","messageId":"20180819215725.29001-5-szeder.dev@gmail.com","threadId":"49165","inReplyTo":"20180819215725.29001-1-szeder.dev@gmail.com","subject":"[PATCH 4/4] tests: use 'test_must_be_empty' instead of 'test_cmp <empty> <out>'","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2018-08-19T21:57:25Z","receivedAt":"2018-08-19T21:57:53Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Using 'test_must_be_empty' is shorter and more idiomatic than\n\n  >empty &&\n  test_cmp empty out\n\nas it saves the creation of an empty file.  Furthermore, sometimes the\nexpected empty file doesn't have such a descriptive name like 'empty',\nand its creation is far away from the place where it's finally used\nfor comparison (e.g. in 't7600-merge.sh', where two expected empty\nfiles are created in the 'setup' test, but are used only about 500\nlines later).\n\nThese cases were found by instrumenting 'test_cmp' to error out the\ntest script when it's used to compare empty files, and then converted\nmanually.\n\nNote that even after this patch there still remain a lot of cases\nwhere we use 'test_cmp' to check empty files:\n\n  - Sometimes the expected output is not hard-coded in the test, but\n    'test_cmp' is used to ensure that two similar git commands produce\n    the same output, and that output happens to be empty, e.g. the\n    test 'submodule update --merge  - ignores --merge  for new\n    submodules' in 't7406-submodule-update.sh'.\n\n  - Repetitive common tasks, including preparing the expected results\n    and running 'test_cmp', are often extracted into a helper\n    function, and some of this helper's callsites expect no output.\n\n  - For the same reason as above, the whole 'test_expect_success'\n    block is within a helper function, e.g. in 't3070-wildmatch.sh'.\n\n  - Or 'test_cmp' is invoked in a loop, e.g. the test 'cvs update\n    (-p)' in 't9400-git-cvsserver-server.sh'.\n\nSigned-off-by: SZEDER Gábor <szeder.dev@gmail.com>\n---\n\nThere is also a related discussion about 'test_cmp' and empty files\nstarting at:\n\n  https://public-inbox.org/git/CAM0VKj=rw14MbLbXvuJiiwf05Txo1tu6A8xzy+_3RHOytX8mXA@mail.gmail.com/T/#md31427850f3ccf8de8252703a49ee431f7e0a6b8\n\n t/t0001-init.sh                              |  5 ++-\n t/t0003-attributes.sh                        |  3 +-\n t/t0030-stripspace.sh                        | 22 ++++++-------\n t/t0040-parse-options.sh                     |  4 +--\n t/t0061-run-command.sh                       |  9 +++---\n t/t1300-config.sh                            |  5 +--\n t/t1410-reflog.sh                            |  3 +-\n t/t1411-reflog-show.sh                       |  3 +-\n t/t1450-fsck.sh                              | 11 +++----\n t/t1600-index.sh                             |  3 +-\n t/t1700-split-index.sh                       |  4 +--\n t/t2200-add-update.sh                        |  3 +-\n t/t2203-add-intent.sh                        |  6 ++--\n t/t3001-ls-files-others-exclude.sh           |  6 ++--\n t/t3004-ls-files-basic.sh                    |  6 ++--\n t/t3035-merge-sparse.sh                      |  5 ++-\n t/t3301-notes.sh                             |  4 +--\n t/t3404-rebase-interactive.sh                |  5 ++-\n t/t4015-diff-whitespace.sh                   |  4 +--\n t/t4027-diff-submodule.sh                    |  3 +-\n t/t4041-diff-submodule-option.sh             |  4 +--\n t/t4060-diff-submodule-option-diff-format.sh |  4 +--\n t/t4132-apply-removal.sh                     |  5 ++-\n t/t4203-mailmap.sh                           |  4 +--\n t/t4212-log-corrupt.sh                       |  6 ++--\n t/t4300-merge-tree.sh                        | 34 ++++----------------\n t/t5304-prune.sh                             |  3 +-\n t/t5314-pack-cycle-detection.sh              |  3 +-\n t/t5526-fetch-submodules.sh                  |  3 +-\n t/t6112-rev-list-filters-objects.sh          |  3 +-\n t/t6120-describe.sh                          |  3 +-\n t/t6130-pathspec-noglob.sh                   |  9 ++----\n t/t6200-fmt-merge-msg.sh                     |  4 +--\n t/t7004-tag.sh                               |  8 ++---\n t/t7008-grep-binary.sh                       |  6 ++--\n t/t7064-wtstatus-pv2.sh                      |  5 +--\n t/t7201-co.sh                                |  3 +-\n t/t7400-submodule-basic.sh                   | 28 ++++++----------\n t/t7501-commit.sh                            |  6 ++--\n t/t7600-merge.sh                             |  9 ++----\n t/t7610-mergetool.sh                         |  3 +-\n t/t7810-grep.sh                              | 31 +++++++-----------\n t/t7811-grep-open.sh                         | 18 ++++-------\n t/t9011-svn-da.sh                            | 14 ++++----\n t/t9200-git-cvsexportcommit.sh               |  4 +--\n t/t9903-bash-prompt.sh                       |  6 ++--\n 46 files changed, 114 insertions(+), 226 deletions(-)\n\ndiff --git a/t/t0001-init.sh b/t/t0001-init.sh\nindex 4c865051e7..28f34fd3bd 100755\n--- a/t/t0001-init.sh\n+++ b/t/t0001-init.sh\n@@ -167,9 +167,8 @@ test_expect_success 'reinit' '\n \t) &&\n \ttest_i18ngrep \"Initialized empty\" again/out1 &&\n \ttest_i18ngrep \"Reinitialized existing\" again/out2 &&\n-\t>again/empty &&\n-\ttest_i18ncmp again/empty again/err1 &&\n-\ttest_i18ncmp again/empty again/err2\n+\ttest_must_be_empty again/err1 &&\n+\ttest_must_be_empty again/err2\n '\n \n test_expect_success 'init with --template' '\ndiff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh\nindex f19ae4f8cc..ee2f5c2389 100755\n--- a/t/t0003-attributes.sh\n+++ b/t/t0003-attributes.sh\n@@ -208,9 +208,8 @@ test_expect_success 'attribute test: --all option' '\n '\n \n test_expect_success 'attribute test: --cached option' '\n-\t: >empty &&\n \tgit check-attr --cached --stdin --all <stdin-all | sort >actual &&\n-\ttest_cmp empty actual &&\n+\ttest_must_be_empty actual &&\n \tgit add .gitattributes a/.gitattributes a/b/.gitattributes &&\n \tgit check-attr --cached --stdin --all <stdin-all | sort >actual &&\n \ttest_cmp specified-all actual\ndiff --git a/t/t0030-stripspace.sh b/t/t0030-stripspace.sh\nindex b77948c618..5ce47e8af5 100755\n--- a/t/t0030-stripspace.sh\n+++ b/t/t0030-stripspace.sh\n@@ -320,22 +320,20 @@ test_expect_success \\\n \n test_expect_success \\\n     'spaces with newline at end should be replaced with empty string' '\n-    printf \"\" >expect &&\n-\n     echo | git stripspace >actual &&\n-    test_cmp expect actual &&\n+    test_must_be_empty actual &&\n \n     echo \"$sss\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+    test_must_be_empty actual &&\n \n     echo \"$sss$sss\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+    test_must_be_empty actual &&\n \n     echo \"$sss$sss$sss\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+    test_must_be_empty actual &&\n \n     echo \"$sss$sss$sss$sss\" | git stripspace >actual &&\n-    test_cmp expect actual\n+    test_must_be_empty actual\n '\n \n test_expect_success \\\n@@ -349,19 +347,17 @@ test_expect_success \\\n \n test_expect_success \\\n     'spaces without newline at end should be replaced with empty string' '\n-    printf \"\" >expect &&\n-\n     printf \"\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+    test_must_be_empty actual &&\n \n     printf \"$sss$sss\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+    test_must_be_empty actual &&\n \n     printf \"$sss$sss$sss\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+    test_must_be_empty actual &&\n \n     printf \"$sss$sss$sss$sss\" | git stripspace >actual &&\n-    test_cmp expect actual\n+    test_must_be_empty actual\n '\n \n test_expect_success \\\ndiff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh\nindex 04d474c84f..5b0560fa20 100755\n--- a/t/t0040-parse-options.sh\n+++ b/t/t0040-parse-options.sh\n@@ -286,11 +286,9 @@ test_expect_success 'OPT_CALLBACK() and OPT_BIT() work' '\n \ttest_cmp expect output\n '\n \n->expect\n-\n test_expect_success 'OPT_CALLBACK() and callback errors work' '\n \ttest_must_fail test-parse-options --no-length >output 2>output.err &&\n-\ttest_i18ncmp expect output &&\n+\ttest_must_be_empty output &&\n \ttest_must_be_empty output.err\n '\n \ndiff --git a/t/t0061-run-command.sh b/t/t0061-run-command.sh\nindex c887ed5b45..3e131c5325 100755\n--- a/t/t0061-run-command.sh\n+++ b/t/t0061-run-command.sh\n@@ -11,7 +11,6 @@ cat >hello-script <<-EOF\n \t#!$SHELL_PATH\n \tcat hello-script\n EOF\n->empty\n \n test_expect_success 'start_command reports ENOENT' '\n \ttest-tool run-command start-command-ENOENT ./does-not-exist\n@@ -23,7 +22,7 @@ test_expect_success 'run_command can run a command' '\n \ttest-tool run-command run-command ./hello.sh >actual 2>err &&\n \n \ttest_cmp hello-script actual &&\n-\ttest_cmp empty err\n+\ttest_must_be_empty err\n '\n \n test_expect_success !MINGW 'run_command can run a script without a #! line' '\n@@ -34,7 +33,7 @@ test_expect_success !MINGW 'run_command can run a script without a #! line' '\n \ttest-tool run-command run-command ./hello >actual 2>err &&\n \n \ttest_cmp hello-script actual &&\n-\ttest_cmp empty err\n+\ttest_must_be_empty err\n '\n \n test_expect_success 'run_command does not try to execute a directory' '\n@@ -47,7 +46,7 @@ test_expect_success 'run_command does not try to execute a directory' '\n \tPATH=$PWD/bin1:$PWD/bin2:$PATH \\\n \t\ttest-tool run-command run-command greet >actual 2>err &&\n \ttest_cmp bin2/greet actual &&\n-\ttest_cmp empty err\n+\ttest_must_be_empty err\n '\n \n test_expect_success POSIXPERM 'run_command passes over non-executable file' '\n@@ -64,7 +63,7 @@ test_expect_success POSIXPERM 'run_command passes over non-executable file' '\n \tPATH=$PWD/bin1:$PWD/bin2:$PATH \\\n \t\ttest-tool run-command run-command greet >actual 2>err &&\n \ttest_cmp bin2/greet actual &&\n-\ttest_cmp empty err\n+\ttest_must_be_empty err\n '\n \n test_expect_success POSIXPERM 'run_command reports EACCES' '\ndiff --git a/t/t1300-config.sh b/t/t1300-config.sh\nindex 03c223708e..84e88cf5a9 100755\n--- a/t/t1300-config.sh\n+++ b/t/t1300-config.sh\n@@ -346,12 +346,9 @@ test_expect_success 'working --list' '\n \tgit config --list > output &&\n \ttest_cmp expect output\n '\n-cat > expect << EOF\n-EOF\n-\n test_expect_success '--list without repo produces empty output' '\n \tgit --git-dir=nonexistent config --list >output &&\n-\ttest_cmp expect output\n+\ttest_must_be_empty output\n '\n \n cat > expect << EOF\ndiff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh\nindex 8293131001..388b0611d8 100755\n--- a/t/t1410-reflog.sh\n+++ b/t/t1410-reflog.sh\n@@ -290,9 +290,8 @@ test_expect_success 'stale dirs do not cause d/f conflicts (reflogs off)' '\n \t# same as before, but we only create a reflog for \"one\" if\n \t# it already exists, which it does not\n \tgit -c core.logallrefupdates=false branch one master &&\n-\t: >expect &&\n \tgit log -g --format=\"%gd %gs\" one >actual &&\n-\ttest_cmp expect actual\n+\ttest_must_be_empty actual\n '\n \n # Triggering the bug detected by this test requires a newline to fall\ndiff --git a/t/t1411-reflog-show.sh b/t/t1411-reflog-show.sh\nindex 596907758d..26590f9a21 100755\n--- a/t/t1411-reflog-show.sh\n+++ b/t/t1411-reflog-show.sh\n@@ -136,13 +136,12 @@ test_expect_success '--date magic does not override explicit @{0} syntax' '\n \ttest_cmp expect actual\n '\n \n-: >expect\n test_expect_success 'empty reflog file' '\n \tgit branch empty &&\n \tgit reflog expire --expire=all refs/heads/empty &&\n \n \tgit log -g empty >actual &&\n-\ttest_cmp expect actual\n+\ttest_must_be_empty actual\n '\n \n # This guards against the alternative of showing the diffs vs. the\ndiff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh\nindex 91fd71444d..a652f6002a 100755\n--- a/t/t1450-fsck.sh\n+++ b/t/t1450-fsck.sh\n@@ -16,8 +16,7 @@ test_expect_success setup '\n \tgit checkout HEAD^0 &&\n \ttest_commit B fileB two &&\n \tgit tag -d A B &&\n-\tgit reflog expire --expire=now --all &&\n-\t>empty\n+\tgit reflog expire --expire=now --all\n '\n \n test_expect_success 'loose objects borrowed from alternate are not missing' '\n@@ -29,12 +28,12 @@ test_expect_success 'loose objects borrowed from alternate are not missing' '\n \t\ttest_commit C fileC one &&\n \t\tgit fsck --no-dangling >../actual 2>&1\n \t) &&\n-\ttest_cmp empty actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'HEAD is part of refs, valid objects appear valid' '\n \tgit fsck >actual 2>&1 &&\n-\ttest_cmp empty actual\n+\ttest_must_be_empty actual\n '\n \n # Corruption tests follow.  Make sure to remove all traces of the\n@@ -346,12 +345,12 @@ test_expect_success 'tag with NUL in header' '\n \n test_expect_success 'cleaned up' '\n \tgit fsck >actual 2>&1 &&\n-\ttest_cmp empty actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'rev-list --verify-objects' '\n \tgit rev-list --verify-objects --all >/dev/null 2>out &&\n-\ttest_cmp empty out\n+\ttest_must_be_empty out\n '\n \n test_expect_success 'rev-list --verify-objects with bad sha1' '\ndiff --git a/t/t1600-index.sh b/t/t1600-index.sh\nindex c4422312f4..42962ed7d4 100755\n--- a/t/t1600-index.sh\n+++ b/t/t1600-index.sh\n@@ -41,8 +41,7 @@ test_expect_success 'no warning with bogus GIT_INDEX_VERSION and existing index'\n \t\tGIT_INDEX_VERSION=1 &&\n \t\texport GIT_INDEX_VERSION &&\n \t\tgit add a 2>actual.err &&\n-\t\t>expect.err &&\n-\t\ttest_i18ncmp expect.err actual.err\n+\t\ttest_must_be_empty actual.err\n \t)\n '\n \ndiff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh\nindex 1e81b33b2e..f85ba57803 100755\n--- a/t/t1700-split-index.sh\n+++ b/t/t1700-split-index.sh\n@@ -143,9 +143,7 @@ test_expect_success 'remove file not in base index' '\n test_expect_success 'remove file in base index' '\n \tgit update-index --force-remove one &&\n \tgit ls-files --stage >ls-files.actual &&\n-\tcat >ls-files.expect <<-EOF &&\n-\tEOF\n-\ttest_cmp ls-files.expect ls-files.actual &&\n+\ttest_must_be_empty ls-files.actual &&\n \n \ttest-tool dump-split-index .git/index | sed \"/^own/d\" >actual &&\n \tcat >expect <<-EOF &&\ndiff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh\nindex 314c73c5a7..f764b7e3f5 100755\n--- a/t/t2200-add-update.sh\n+++ b/t/t2200-add-update.sh\n@@ -88,9 +88,8 @@ test_expect_success 'non-qualified update in subdir updates from the root' '\n \t\techo even more >>sub2 &&\n \t\tgit add -u\n \t) &&\n-\t: >expect &&\n \tgit diff-files --name-only >actual &&\n-\ttest_cmp expect actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'replace a file with a symlink' '\ndiff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh\nindex e7a400b4c7..68e54d5c44 100755\n--- a/t/t2203-add-intent.sh\n+++ b/t/t2203-add-intent.sh\n@@ -195,8 +195,7 @@ test_expect_success 'rename detection finds the right names' '\n \t\ttest_cmp expected.4 actual.4 &&\n \n \t\tgit diff --cached --stat >actual.5 &&\n-\t\t: >expected.5 &&\n-\t\ttest_cmp expected.5 actual.5\n+\t\ttest_must_be_empty actual.5\n \n \t)\n '\n@@ -241,8 +240,7 @@ test_expect_success 'diff-files/diff-cached shows ita as new/not-new files' '\n \techo \" create mode 100644 new-ita\" >expected &&\n \ttest_cmp expected actual &&\n \tgit diff --cached --summary >actual2 &&\n-\t: >expected2 &&\n-\ttest_cmp expected2 actual2\n+\ttest_must_be_empty actual2\n '\n \n \ndiff --git a/t/t3001-ls-files-others-exclude.sh b/t/t3001-ls-files-others-exclude.sh\nindex 3b47647ed5..1ec7cb57c7 100755\n--- a/t/t3001-ls-files-others-exclude.sh\n+++ b/t/t3001-ls-files-others-exclude.sh\n@@ -277,9 +277,8 @@ test_expect_success 'hide empty ignored sub-directory with --no-empty-directory'\n '\n \n test_expect_success 'pattern matches prefix completely' '\n-\t: >expect &&\n \tgit ls-files -i -o --exclude \"/three/a.3[abc]\" >actual &&\n-\ttest_cmp expect actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'ls-files with \"**\" patterns' '\n@@ -295,9 +294,8 @@ EOF\n \n \n test_expect_success 'ls-files with \"**\" patterns and no slashes' '\n-\t: >expect &&\n \tgit ls-files -o -i --exclude \"one**a.1\" >actual &&\n-\ttest_cmp expect actual\n+\ttest_must_be_empty actual\n '\n \n test_done\ndiff --git a/t/t3004-ls-files-basic.sh b/t/t3004-ls-files-basic.sh\nindex 9c7adbdbe1..9fd5a1f188 100755\n--- a/t/t3004-ls-files-basic.sh\n+++ b/t/t3004-ls-files-basic.sh\n@@ -8,16 +8,14 @@ command-line arguments.\n \n . ./test-lib.sh\n \n->empty\n-\n test_expect_success 'ls-files in empty repository' '\n \tgit ls-files >actual &&\n-\ttest_cmp empty actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'ls-files with nonexistent path' '\n \tgit ls-files doesnotexist >actual &&\n-\ttest_cmp empty actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'ls-files with nonsense option' '\ndiff --git a/t/t3035-merge-sparse.sh b/t/t3035-merge-sparse.sh\nindex 0c0b433bd3..c4b4a94324 100755\n--- a/t/t3035-merge-sparse.sh\n+++ b/t/t3035-merge-sparse.sh\n@@ -17,7 +17,6 @@ test_commit_this () {\n }\n \n test_expect_success 'setup' '\n-\t: >empty &&\n \ttest_file checked-out init &&\n \ttest_file modify_delete modify_delete_init &&\n \ttest_commit_this init &&\n@@ -38,7 +37,7 @@ test_expect_success 'reset --hard works after the conflict' '\n \n test_expect_success 'is reset properly' '\n \tgit status --porcelain -- modify_delete >out &&\n-\ttest_cmp empty out &&\n+\ttest_must_be_empty out &&\n \ttest_path_is_missing modify_delete\n '\n \n@@ -52,7 +51,7 @@ test_expect_success 'Merge abort works after the conflict' '\n \n test_expect_success 'is aborted properly' '\n \tgit status --porcelain -- modify_delete >out &&\n-\ttest_cmp empty out &&\n+\ttest_must_be_empty out &&\n \ttest_path_is_missing modify_delete\n '\n \ndiff --git a/t/t3301-notes.sh b/t/t3301-notes.sh\nindex 2d200fdf36..e5703a0d5b 100755\n--- a/t/t3301-notes.sh\n+++ b/t/t3301-notes.sh\n@@ -481,10 +481,8 @@ test_expect_success 'list specific note with \"git notes list <object>\"' '\n '\n \n test_expect_success 'listing non-existing notes fails' '\n-\tcat >expect <<-EOF &&\n-\tEOF\n \ttest_must_fail git notes list HEAD >actual &&\n-\ttest_cmp expect actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'append to existing note with \"git notes append\"' '\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 01616901bd..5997770dc3 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -787,16 +787,15 @@ test_expect_success 'always cherry-pick with --no-ff' '\n \tgit tag original-no-ff-branch &&\n \tset_fake_editor &&\n \tgit rebase -i --no-ff A &&\n-\ttouch empty &&\n \tfor p in 0 1 2\n \tdo\n \t\ttest ! $(git rev-parse HEAD~$p) = $(git rev-parse original-no-ff-branch~$p) &&\n \t\tgit diff HEAD~$p original-no-ff-branch~$p > out &&\n-\t\ttest_cmp empty out\n+\t\ttest_must_be_empty out\n \tdone &&\n \ttest $(git rev-parse HEAD~3) = $(git rev-parse original-no-ff-branch~3) &&\n \tgit diff HEAD~3 original-no-ff-branch~3 > out &&\n-\ttest_cmp empty out\n+\ttest_must_be_empty out\n '\n \n test_expect_success 'set up commits with funny messages' '\ndiff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh\nindex 5659c2612d..1ea9e0d21d 100755\n--- a/t/t4015-diff-whitespace.sh\n+++ b/t/t4015-diff-whitespace.sh\n@@ -776,8 +776,6 @@ test_expect_success 'checkdiff allows new blank lines' '\n \tgit diff --check\n '\n \n-cat <<EOF >expect\n-EOF\n test_expect_success 'whitespace-only changes not reported' '\n \tgit reset --hard &&\n \techo >x \"hello world\" &&\n@@ -785,7 +783,7 @@ test_expect_success 'whitespace-only changes not reported' '\n \tgit commit -m \"hello 1\" &&\n \techo >x \"hello  world\" &&\n \tgit diff -b >actual &&\n-\ttest_cmp expect actual\n+\ttest_must_be_empty actual\n '\n \n cat <<EOF >expect\ndiff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh\nindex e5f9eb7a11..9aa8e2b39b 100755\n--- a/t/t4027-diff-submodule.sh\n+++ b/t/t4027-diff-submodule.sh\n@@ -239,10 +239,9 @@ test_expect_success 'git diff between submodule commits [.gitmodules]' '\n '\n \n test_expect_success 'git diff (empty submodule dir)' '\n-\t: >empty &&\n \trm -rf sub/* sub/.git &&\n \tgit diff > actual.empty &&\n-\ttest_cmp empty actual.empty\n+\ttest_must_be_empty actual.empty\n '\n \n test_expect_success 'conflicted submodule setup' '\ndiff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh\nindex 302f2166a9..7a4594224b 100755\n--- a/t/t4041-diff-submodule-option.sh\n+++ b/t/t4041-diff-submodule-option.sh\n@@ -257,9 +257,7 @@ test_expect_success 'typechanged submodule(blob->submodule)' '\n commit_file sm1 &&\n test_expect_success 'submodule is up to date' '\n \tgit diff-index -p --submodule=log HEAD >actual &&\n-\tcat >expected <<-EOF &&\n-\tEOF\n-\ttest_cmp expected actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'submodule contains untracked content' '\ndiff --git a/t/t4060-diff-submodule-option-diff-format.sh b/t/t4060-diff-submodule-option-diff-format.sh\nindex 6fc3da8bd2..60c8dc75a9 100755\n--- a/t/t4060-diff-submodule-option-diff-format.sh\n+++ b/t/t4060-diff-submodule-option-diff-format.sh\n@@ -392,9 +392,7 @@ test_expect_success 'typechanged submodule(blob->submodule)' '\n commit_file sm1 &&\n test_expect_success 'submodule is up to date' '\n \tgit diff-index -p --submodule=diff HEAD >actual &&\n-\tcat >expected <<-EOF &&\n-\tEOF\n-\ttest_cmp expected actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'submodule contains untracked content' '\ndiff --git a/t/t4132-apply-removal.sh b/t/t4132-apply-removal.sh\nindex a2bc1cd37d..fec1d6fa51 100755\n--- a/t/t4132-apply-removal.sh\n+++ b/t/t4132-apply-removal.sh\n@@ -49,8 +49,7 @@ test_expect_success setup '\n \tsed -e \"s/TS0/$timeGMT/\" -e \"s/TS1/$epocGMT/\" <d >removeGMT.patch &&\n \tsed -e \"s/TS0/$timeWest/\" -e \"s/TS1/$epocWest2/\" <d >removeWest2.patch &&\n \n-\techo something >something &&\n-\t>empty\n+\techo something >something\n '\n \n for patch in *.patch\n@@ -81,7 +80,7 @@ do\n \t\t\tgit add file &&\n \t\t\tgit apply --index $patch &&\n \t\t\ttest -f file &&\n-\t\t\ttest_cmp empty file\n+\t\t\ttest_must_be_empty file\n \t\t\t;;\n \t\tremove*)\n \t\t\t# must remove the file\ndiff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh\nindex 0dd8b65d7c..43b1522ea2 100755\n--- a/t/t4203-mailmap.sh\n+++ b/t/t4203-mailmap.sh\n@@ -461,11 +461,9 @@ test_expect_success 'Grep author with log.mailmap' '\n \ttest_cmp expect actual\n '\n \n->expect\n-\n test_expect_success 'Only grep replaced author with --use-mailmap' '\n \tgit log --use-mailmap --author \"<cto@coompany.xx>\" >actual &&\n-\ttest_cmp expect actual\n+\ttest_must_be_empty actual\n '\n \n # git blame\ndiff --git a/t/t4212-log-corrupt.sh b/t/t4212-log-corrupt.sh\nindex 22aa8b7c0e..03b952c90d 100755\n--- a/t/t4212-log-corrupt.sh\n+++ b/t/t4212-log-corrupt.sh\n@@ -26,22 +26,20 @@ test_expect_success 'git log with broken author email' '\n \t\techo\n \t\techo \"    foo\"\n \t} >expect.out &&\n-\t: >expect.err &&\n \n \tgit log broken_email >actual.out 2>actual.err &&\n \n \ttest_cmp expect.out actual.out &&\n-\ttest_cmp expect.err actual.err\n+\ttest_must_be_empty actual.err\n '\n \n test_expect_success 'git log --format with broken author email' '\n \techo \"A U Thor+author@example.com+Thu Apr 7 15:13:13 2005 -0700\" >expect.out &&\n-\t: >expect.err &&\n \n \tgit log --format=\"%an+%ae+%ad\" broken_email >actual.out 2>actual.err &&\n \n \ttest_cmp expect.out actual.out &&\n-\ttest_cmp expect.err actual.err\n+\ttest_must_be_empty actual.err\n '\n \n munge_author_date () {\ndiff --git a/t/t4300-merge-tree.sh b/t/t4300-merge-tree.sh\nindex 9015e47654..d87cc7d9ef 100755\n--- a/t/t4300-merge-tree.sh\n+++ b/t/t4300-merge-tree.sh\n@@ -25,25 +25,19 @@ EXPECTED\n '\n \n test_expect_success 'file add !A, B' '\n-\tcat >expected <<\\EXPECTED &&\n-EXPECTED\n-\n \tgit reset --hard initial &&\n \ttest_commit \"add-not-a-b\" \"ONE\" \"AAA\" &&\n \tgit merge-tree initial add-not-a-b initial >actual &&\n-\ttest_cmp expected actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'file add A, B (same)' '\n-\tcat >expected <<\\EXPECTED &&\n-EXPECTED\n-\n \tgit reset --hard initial &&\n \ttest_commit \"add-a-b-same-A\" \"ONE\" \"AAA\" &&\n \tgit reset --hard initial &&\n \ttest_commit \"add-a-b-same-B\" \"ONE\" \"AAA\" &&\n \tgit merge-tree initial add-a-b-same-A add-a-b-same-B >actual &&\n-\ttest_cmp expected actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'file add A, B (different)' '\n@@ -68,13 +62,10 @@ EXPECTED\n '\n \n test_expect_success 'file change A, !B' '\n-\tcat >expected <<\\EXPECTED &&\n-EXPECTED\n-\n \tgit reset --hard initial &&\n \ttest_commit \"change-a-not-b\" \"initial-file\" \"BBB\" &&\n \tgit merge-tree initial change-a-not-b initial >actual &&\n-\ttest_cmp expected actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'file change !A, B' '\n@@ -94,15 +85,12 @@ EXPECTED\n '\n \n test_expect_success 'file change A, B (same)' '\n-\tcat >expected <<\\EXPECTED &&\n-EXPECTED\n-\n \tgit reset --hard initial &&\n \ttest_commit \"change-a-b-same-A\" \"initial-file\" \"AAA\" &&\n \tgit reset --hard initial &&\n \ttest_commit \"change-a-b-same-B\" \"initial-file\" \"AAA\" &&\n \tgit merge-tree initial change-a-b-same-A change-a-b-same-B >actual &&\n-\ttest_cmp expected actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'file change A, B (different)' '\n@@ -175,16 +163,13 @@ AAA\" &&\n '\n \n test_expect_success 'file remove A, !B' '\n-\tcat >expected <<\\EXPECTED &&\n-EXPECTED\n-\n \tgit reset --hard initial &&\n \ttest_commit \"rm-a-not-b-base\" \"ONE\" \"AAA\" &&\n \tgit rm ONE &&\n \tgit commit -m \"rm-a-not-b\" &&\n \tgit tag \"rm-a-not-b\" &&\n \tgit merge-tree rm-a-not-b-base rm-a-not-b rm-a-not-b-base >actual &&\n-\ttest_cmp expected actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'file remove !A, B' '\n@@ -206,16 +191,13 @@ EXPECTED\n '\n \n test_expect_success 'file remove A, B (same)' '\n-\tcat >expected <<\\EXPECTED &&\n-EXPECTED\n-\n \tgit reset --hard initial &&\n \ttest_commit \"rm-a-b-base\" \"ONE\" \"AAA\" &&\n \tgit rm ONE &&\n \tgit commit -m \"rm-a-b\" &&\n \tgit tag \"rm-a-b\" &&\n \tgit merge-tree rm-a-b-base rm-a-b rm-a-b >actual &&\n-\ttest_cmp expected actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'file change A, remove B' '\n@@ -260,13 +242,11 @@ EXPECTED\n '\n \n test_expect_success 'tree add A, B (same)' '\n-\tcat >expect <<-\\EOF &&\n-\tEOF\n \tgit reset --hard initial &&\n \tmkdir sub &&\n \ttest_commit \"add sub/file\" \"sub/file\" \"file\" add-tree-A &&\n \tgit merge-tree initial add-tree-A add-tree-A >actual &&\n-\ttest_cmp expect actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'tree add A, B (different)' '\ndiff --git a/t/t5304-prune.sh b/t/t5304-prune.sh\nindex f20f03c103..270da21ac3 100755\n--- a/t/t5304-prune.sh\n+++ b/t/t5304-prune.sh\n@@ -112,8 +112,7 @@ test_expect_success 'prune: do not prune detached HEAD with no reflog' '\n \t# (should be removed and disabled by previous test)\n \ttest_path_is_missing .git/logs &&\n \tgit prune -n >prune_actual &&\n-\t: >prune_expected &&\n-\ttest_cmp prune_actual prune_expected\n+\ttest_must_be_empty prune_actual\n \n '\n \ndiff --git a/t/t5314-pack-cycle-detection.sh b/t/t5314-pack-cycle-detection.sh\nindex f31995d3d2..e525466de0 100755\n--- a/t/t5314-pack-cycle-detection.sh\n+++ b/t/t5314-pack-cycle-detection.sh\n@@ -98,9 +98,8 @@ test_expect_success 'repack' '\n \t# We first want to check that we do not have any internal errors,\n \t# and also that we do not hit the last-ditch cycle-breaking code\n \t# in write_object(), which will issue a warning to stderr.\n-\t>expect &&\n \tgit repack -ad 2>stderr &&\n-\ttest_cmp expect stderr &&\n+\ttest_must_be_empty stderr &&\n \n \t# And then double-check that the resulting pack is usable (i.e.,\n \t# we did not fail to notice any cycles). We know we are accessing\ndiff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh\nindex ce3af92843..fc95df0d0d 100755\n--- a/t/t5526-fetch-submodules.sh\n+++ b/t/t5526-fetch-submodules.sh\n@@ -495,7 +495,6 @@ test_expect_success \"'fetch.recurseSubmodules=on-demand' works also without .git\n \tgit add submodule &&\n \tgit rm .gitmodules &&\n \tgit commit -m \"new submodule without .gitmodules\" &&\n-\tprintf \"\" >expect.out &&\n \thead2=$(git rev-parse --short HEAD) &&\n \techo \"From $pwd/.\" >expect.err.2 &&\n \techo \"   $head1..$head2  master     -> origin/master\" >>expect.err.2 &&\n@@ -514,7 +513,7 @@ test_expect_success \"'fetch.recurseSubmodules=on-demand' works also without .git\n \t\tgit config --unset fetch.recurseSubmodules &&\n \t\tgit reset --hard\n \t) &&\n-\ttest_i18ncmp expect.out actual.out &&\n+\ttest_must_be_empty actual.out &&\n \ttest_i18ncmp expect.err.2 actual.err &&\n \tgit checkout HEAD^ -- .gitmodules &&\n \tgit add .gitmodules &&\ndiff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh\nindex 0a37dd5f97..d4ff0b3bef 100755\n--- a/t/t6112-rev-list-filters-objects.sh\n+++ b/t/t6112-rev-list-filters-objects.sh\n@@ -113,12 +113,11 @@ test_expect_success 'verify blob:limit=1k' '\n '\n \n test_expect_success 'verify blob:limit=1m' '\n-\tcat </dev/null >expected &&\n \tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m \\\n \t\t| awk -f print_1.awk \\\n \t\t| sed \"s/~//\" \\\n \t\t| sort >observed &&\n-\ttest_cmp observed expected\n+\ttest_must_be_empty observed\n '\n \n # Test sparse:path=<path> filter.\ndiff --git a/t/t6120-describe.sh b/t/t6120-describe.sh\nindex 84dd1cb690..d639d94696 100755\n--- a/t/t6120-describe.sh\n+++ b/t/t6120-describe.sh\n@@ -121,10 +121,9 @@ test_expect_success 'describe --contains defaults to HEAD without commit-ish' '\n \ttest_cmp expect actual\n '\n \n-: >err.expect\n check_describe tags/A --all A^0\n test_expect_success 'no warning was displayed for A' '\n-\ttest_cmp err.expect err.actual\n+\ttest_must_be_empty err.actual\n '\n \n test_expect_success 'rename tag A to Q locally' '\ndiff --git a/t/t6130-pathspec-noglob.sh b/t/t6130-pathspec-noglob.sh\nindex 658353277e..37760233a5 100755\n--- a/t/t6130-pathspec-noglob.sh\n+++ b/t/t6130-pathspec-noglob.sh\n@@ -97,9 +97,8 @@ test_expect_success 'no-glob option matches literally (bracket)' '\n '\n \n test_expect_success 'no-glob option disables :(literal)' '\n-\t: >expect &&\n \tgit --literal-pathspecs log --format=%s -- \":(literal)foo\" >actual &&\n-\ttest_cmp expect actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'no-glob environment variable works' '\n@@ -130,9 +129,8 @@ test_expect_success '**/ works with :(glob)' '\n '\n \n test_expect_success '**/ does not work with --noglob-pathspecs' '\n-\t: >expect &&\n \tgit --noglob-pathspecs log --format=%s -- \"**/bar\" >actual &&\n-\ttest_cmp expect actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success '**/ works with :(glob) and --noglob-pathspecs' '\n@@ -154,9 +152,8 @@ test_expect_success '**/ works with --glob-pathspecs' '\n '\n \n test_expect_success '**/ does not work with :(literal) and --glob-pathspecs' '\n-\t: >expect &&\n \tgit --glob-pathspecs log --format=%s -- \":(literal)**/bar\" >actual &&\n-\ttest_cmp expect actual\n+\ttest_must_be_empty actual\n '\n \n test_done\ndiff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh\nindex a54a52aaa4..93f23cfa82 100755\n--- a/t/t6200-fmt-merge-msg.sh\n+++ b/t/t6200-fmt-merge-msg.sh\n@@ -366,8 +366,6 @@ test_expect_success 'merge-msg with nothing to merge' '\n \ttest_unconfig merge.log &&\n \ttest_config merge.summary yes &&\n \n-\t>empty &&\n-\n \t(\n \t\tcd remote &&\n \t\tgit checkout -b unrelated &&\n@@ -376,7 +374,7 @@ test_expect_success 'merge-msg with nothing to merge' '\n \t\tgit fmt-merge-msg <.git/FETCH_HEAD >../actual\n \t) &&\n \n-\ttest_cmp empty actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'merge-msg tag' '\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex 93a6694f0e..2e17cdb084 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -325,11 +325,10 @@ test_expect_success \\\n \ttest_cmp expect actual\n '\n \n->expect\n test_expect_success \\\n \t'listing tags using v.* should print nothing because none have v.' '\n \tgit tag -l \"v.*\" > actual &&\n-\ttest_cmp expect actual\n+\ttest_must_be_empty actual\n '\n \n cat >expect <<EOF\n@@ -1498,12 +1497,9 @@ test_expect_success 'inverse of the last test, with --no-contains' \"\n \ttest_cmp expected actual\n \"\n \n-cat > expected <<EOF\n-EOF\n-\n test_expect_success 'checking that third commit has no tags' \"\n \tgit tag -l --contains $hash3 v* >actual &&\n-\ttest_cmp expected actual\n+\ttest_must_be_empty actual\n \"\n \n cat > expected <<EOF\ndiff --git a/t/t7008-grep-binary.sh b/t/t7008-grep-binary.sh\nindex 615e7e0162..2d87c49b75 100755\n--- a/t/t7008-grep-binary.sh\n+++ b/t/t7008-grep-binary.sh\n@@ -57,9 +57,8 @@ test_expect_success 'git grep -ah ina a' '\n '\n \n test_expect_success 'git grep -I ina a' '\n-\t: >expect &&\n \ttest_must_fail git grep -I ina a >actual &&\n-\ttest_cmp expect actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'git grep -c ina a' '\n@@ -81,9 +80,8 @@ test_expect_success 'git grep -L bar a' '\n '\n \n test_expect_success 'git grep -q ina a' '\n-\t: >expect &&\n \tgit grep -q ina a >actual &&\n-\ttest_cmp expect actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'git grep -F ile a' '\ndiff --git a/t/t7064-wtstatus-pv2.sh b/t/t7064-wtstatus-pv2.sh\nindex b9a86d3347..11eccc231a 100755\n--- a/t/t7064-wtstatus-pv2.sh\n+++ b/t/t7064-wtstatus-pv2.sh\n@@ -364,11 +364,8 @@ test_expect_success 'verify upstream fields in branch header' '\n \t\ttest_cmp expect actual &&\n \n \t\t## Repeat the above but without --branch.\n-\t\tcat >expect <<-EOF &&\n-\t\tEOF\n-\n \t\tgit status --porcelain=v2 --untracked-files=all >actual &&\n-\t\ttest_cmp expect actual &&\n+\t\ttest_must_be_empty actual &&\n \n \t\t## Test upstream-gone case. Fake this by pointing origin/master at\n \t\t## a non-existing commit.\ndiff --git a/t/t7201-co.sh b/t/t7201-co.sh\nindex 0e7d4421a7..d67b10ce00 100755\n--- a/t/t7201-co.sh\n+++ b/t/t7201-co.sh\n@@ -116,9 +116,8 @@ test_expect_success \"checkout -m with dirty tree\" '\n \tgit diff --name-status side >current.side &&\n \ttest_cmp expect.side current.side &&\n \n-\t: >expect.index &&\n \tgit diff --cached >current.index &&\n-\ttest_cmp expect.index current.index\n+\ttest_must_be_empty current.index\n '\n \n test_expect_success \"checkout -m with dirty tree, renamed\" '\ndiff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh\nindex 48fd14fae6..894ea2f27d 100755\n--- a/t/t7400-submodule-basic.sh\n+++ b/t/t7400-submodule-basic.sh\n@@ -101,7 +101,6 @@ inspect() {\n \n test_expect_success 'submodule add' '\n \techo \"refs/heads/master\" >expect &&\n-\t>empty &&\n \n \t(\n \t\tcd addtest &&\n@@ -123,7 +122,7 @@ test_expect_success 'submodule add' '\n \tinspect addtest/submod ../.. &&\n \ttest_cmp expect heads &&\n \ttest_cmp expect head &&\n-\ttest_cmp empty untracked\n+\ttest_must_be_empty untracked\n '\n \n test_expect_success 'setup parent and one repository' '\n@@ -188,7 +187,6 @@ test_expect_success 'submodule add --branch' '\n \trefs/heads/initial\n \trefs/heads/master\n \tEOF\n-\t>empty &&\n \n \t(\n \t\tcd addtest &&\n@@ -201,12 +199,11 @@ test_expect_success 'submodule add --branch' '\n \tinspect addtest/submod-branch ../.. &&\n \ttest_cmp expect-heads heads &&\n \ttest_cmp expect-head head &&\n-\ttest_cmp empty untracked\n+\ttest_must_be_empty untracked\n '\n \n test_expect_success 'submodule add with ./ in path' '\n \techo \"refs/heads/master\" >expect &&\n-\t>empty &&\n \n \t(\n \t\tcd addtest &&\n@@ -218,12 +215,11 @@ test_expect_success 'submodule add with ./ in path' '\n \tinspect addtest/dotsubmod/frotz ../../.. &&\n \ttest_cmp expect heads &&\n \ttest_cmp expect head &&\n-\ttest_cmp empty untracked\n+\ttest_must_be_empty untracked\n '\n \n test_expect_success 'submodule add with /././ in path' '\n \techo \"refs/heads/master\" >expect &&\n-\t>empty &&\n \n \t(\n \t\tcd addtest &&\n@@ -235,12 +231,11 @@ test_expect_success 'submodule add with /././ in path' '\n \tinspect addtest/dotslashdotsubmod/frotz ../../.. &&\n \ttest_cmp expect heads &&\n \ttest_cmp expect head &&\n-\ttest_cmp empty untracked\n+\ttest_must_be_empty untracked\n '\n \n test_expect_success 'submodule add with // in path' '\n \techo \"refs/heads/master\" >expect &&\n-\t>empty &&\n \n \t(\n \t\tcd addtest &&\n@@ -252,12 +247,11 @@ test_expect_success 'submodule add with // in path' '\n \tinspect addtest/slashslashsubmod/frotz ../../.. &&\n \ttest_cmp expect heads &&\n \ttest_cmp expect head &&\n-\ttest_cmp empty untracked\n+\ttest_must_be_empty untracked\n '\n \n test_expect_success 'submodule add with /.. in path' '\n \techo \"refs/heads/master\" >expect &&\n-\t>empty &&\n \n \t(\n \t\tcd addtest &&\n@@ -269,12 +263,11 @@ test_expect_success 'submodule add with /.. in path' '\n \tinspect addtest/realsubmod ../.. &&\n \ttest_cmp expect heads &&\n \ttest_cmp expect head &&\n-\ttest_cmp empty untracked\n+\ttest_must_be_empty untracked\n '\n \n test_expect_success 'submodule add with ./, /.. and // in path' '\n \techo \"refs/heads/master\" >expect &&\n-\t>empty &&\n \n \t(\n \t\tcd addtest &&\n@@ -286,7 +279,7 @@ test_expect_success 'submodule add with ./, /.. and // in path' '\n \tinspect addtest/realsubmod2 ../.. &&\n \ttest_cmp expect heads &&\n \ttest_cmp expect head &&\n-\ttest_cmp empty untracked\n+\ttest_must_be_empty untracked\n '\n \n test_expect_success !CYGWIN 'submodule add with \\\\ in path' '\n@@ -305,7 +298,6 @@ test_expect_success !CYGWIN 'submodule add with \\\\ in path' '\n \n test_expect_success 'submodule add in subdirectory' '\n \techo \"refs/heads/master\" >expect &&\n-\t>empty &&\n \n \tmkdir addtest/sub &&\n \t(\n@@ -318,7 +310,7 @@ test_expect_success 'submodule add in subdirectory' '\n \tinspect addtest/realsubmod3 ../.. &&\n \ttest_cmp expect heads &&\n \ttest_cmp expect head &&\n-\ttest_cmp empty untracked\n+\ttest_must_be_empty untracked\n '\n \n test_expect_success 'submodule add in subdirectory with relative path should fail' '\n@@ -501,8 +493,6 @@ test_expect_success 'checkout superproject with subproject already present' '\n '\n \n test_expect_success 'apply submodule diff' '\n-\t>empty &&\n-\n \tgit branch second &&\n \t(\n \t\tcd init &&\n@@ -517,7 +507,7 @@ test_expect_success 'apply submodule diff' '\n \tgit apply --index P.diff &&\n \n \tgit diff --cached master >staged &&\n-\ttest_cmp empty staged\n+\ttest_must_be_empty staged\n '\n \n test_expect_success 'update --init' '\ndiff --git a/t/t7501-commit.sh b/t/t7501-commit.sh\nindex 9dbbd01fc0..c1d232e92d 100755\n--- a/t/t7501-commit.sh\n+++ b/t/t7501-commit.sh\n@@ -582,13 +582,11 @@ test_expect_success 'same tree (merge and amend merge)' '\n \n \tgit merge -s ours side -m \"empty ok\" &&\n \tgit diff HEAD^ HEAD >actual &&\n-\t: >expected &&\n-\ttest_cmp expected actual &&\n+\ttest_must_be_empty actual &&\n \n \tgit commit --amend -m \"empty really ok\" &&\n \tgit diff HEAD^ HEAD >actual &&\n-\t: >expected &&\n-\ttest_cmp expected actual\n+\ttest_must_be_empty actual\n \n '\n \ndiff --git a/t/t7600-merge.sh b/t/t7600-merge.sh\nindex 6736d8d131..106148254d 100755\n--- a/t/t7600-merge.sh\n+++ b/t/t7600-merge.sh\n@@ -38,7 +38,6 @@ printf '%s\\n' '1 X' 2 3 4 5 6 7 8 9 >result.1\n printf '%s\\n' '1 X' 2 3 4 '5 X' 6 7 8 9 >result.1-5\n printf '%s\\n' '1 X' 2 3 4 '5 X' 6 7 8 '9 X' >result.1-5-9\n printf '%s\\n' 1 2 3 4 5 6 7 8 '9 Z' >result.9z\n->empty\n \n create_merge_msgs () {\n \techo \"Merge tag 'c2'\" >msg.1-5 &&\n@@ -58,8 +57,6 @@ create_merge_msgs () {\n \t\techo &&\n \t\tgit log --no-merges ^HEAD c2 c3\n \t} >squash.1-5-9 &&\n-\t: >msg.nologff &&\n-\t: >msg.nolognoff &&\n \t{\n \t\techo \"* tag 'c3':\" &&\n \t\techo \"  commit 3\"\n@@ -519,7 +516,7 @@ test_expect_success 'tolerate unknown values for merge.ff' '\n \ttest_tick &&\n \tgit merge c1 2>message &&\n \tverify_head \"$c1\" &&\n-\ttest_cmp empty message\n+\ttest_must_be_empty message\n '\n \n test_expect_success 'combining --squash and --no-ff is refused' '\n@@ -551,13 +548,13 @@ test_expect_success 'merge log message' '\n \tgit reset --hard c0 &&\n \tgit merge --no-log c2 &&\n \tgit show -s --pretty=format:%b HEAD >msg.act &&\n-\ttest_cmp msg.nologff msg.act &&\n+\ttest_must_be_empty msg.act &&\n \n \tgit reset --hard c0 &&\n \ttest_config branch.master.mergeoptions \"--no-ff\" &&\n \tgit merge --no-log c2 &&\n \tgit show -s --pretty=format:%b HEAD >msg.act &&\n-\ttest_cmp msg.nolognoff msg.act &&\n+\ttest_must_be_empty msg.act &&\n \n \tgit merge --log c3 &&\n \tgit show -s --pretty=format:%b HEAD >msg.act &&\ndiff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh\nindex 4d46c599f8..78bed2aee1 100755\n--- a/t/t7610-mergetool.sh\n+++ b/t/t7610-mergetool.sh\n@@ -328,9 +328,8 @@ test_expect_success 'mergetool produces no errors when keepBackup is used' '\n \tgit checkout -b test$test_count move-to-c &&\n \ttest_config mergetool.keepBackup true &&\n \ttest_must_fail git merge move-to-b &&\n-\t: >expect &&\n \techo d | git mergetool a/a/file.txt 2>actual &&\n-\ttest_cmp expect actual &&\n+\ttest_must_be_empty actual &&\n \t! test -d a\n '\n \ndiff --git a/t/t7810-grep.sh b/t/t7810-grep.sh\nindex 42d5354c2a..c82c8f5f72 100755\n--- a/t/t7810-grep.sh\n+++ b/t/t7810-grep.sh\n@@ -217,9 +217,8 @@ do\n \t'\n \n \ttest_expect_success \"grep -w $L (w)\" '\n-\t\t: >expected &&\n \t\ttest_must_fail git grep -n -w -e \"^w\" $H >actual &&\n-\t\ttest_cmp expected actual\n+\t\ttest_must_be_empty actual\n \t'\n \n \ttest_expect_success \"grep -w $L (x)\" '\n@@ -239,26 +238,24 @@ do\n \t'\n \n \ttest_expect_success \"grep -w $L (y-2)\" '\n-\t\t: >expected &&\n \t\tif git grep -n -w -e \"^y y\" $H >actual\n \t\tthen\n \t\t\techo should not have matched\n \t\t\tcat actual\n \t\t\tfalse\n \t\telse\n-\t\t\ttest_cmp expected actual\n+\t\t\ttest_must_be_empty actual\n \t\tfi\n \t'\n \n \ttest_expect_success \"grep -w $L (z)\" '\n-\t\t: >expected &&\n \t\tif git grep -n -w -e \"^z\" $H >actual\n \t\tthen\n \t\t\techo should not have matched\n \t\t\tcat actual\n \t\t\tfalse\n \t\telse\n-\t\t\ttest_cmp expected actual\n+\t\t\ttest_must_be_empty actual\n \t\tfi\n \t'\n \n@@ -604,11 +601,10 @@ z:zzz\n EOF\n \n test_expect_success 'grep -q, silently report matches' '\n-\t>empty &&\n \tgit grep -q mmap >actual &&\n-\ttest_cmp empty actual &&\n+\ttest_must_be_empty actual &&\n \ttest_must_fail git grep -q qfwfq >actual &&\n-\ttest_cmp empty actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'grep -C1 hunk mark between files' '\n@@ -701,8 +697,7 @@ test_expect_success 'log grep (9)' '\n \n test_expect_success 'log grep (9)' '\n \tgit log -g --grep-reflog=\"commit: third\" --author=\"non-existent\" --pretty=tformat:%s >actual &&\n-\t: >expect &&\n-\ttest_cmp expect actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'log --grep-reflog can only be used under -g' '\n@@ -792,15 +787,13 @@ test_expect_success 'log --all-match --grep --grep --author takes intersection'\n '\n \n test_expect_success 'log --author does not search in timestamp' '\n-\t: >expect &&\n \tgit log --author=\"$GIT_AUTHOR_DATE\" >actual &&\n-\ttest_cmp expect actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'log --committer does not search in timestamp' '\n-\t: >expect &&\n \tgit log --committer=\"$GIT_COMMITTER_DATE\" >actual &&\n-\ttest_cmp expect actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'grep with CE_VALID file' '\n@@ -1051,13 +1044,12 @@ test_expect_success 'inside git repository but with --no-index' '\n \t\techo \".gitignore:.*o*\" &&\n \t\tcat is/expect.unignored\n \t} >is/expect.full &&\n-\t: >is/expect.empty &&\n \techo file2:world >is/expect.sub &&\n \t(\n \t\tcd is/git &&\n \t\tgit init &&\n \t\ttest_must_fail git grep o >../actual.full &&\n-\t\ttest_cmp ../expect.empty ../actual.full &&\n+\t\ttest_must_be_empty ../actual.full &&\n \n \t\tgit grep --untracked o >../actual.unignored &&\n \t\ttest_cmp ../expect.unignored ../actual.unignored &&\n@@ -1070,7 +1062,7 @@ test_expect_success 'inside git repository but with --no-index' '\n \n \t\tcd sub &&\n \t\ttest_must_fail git grep o >../../actual.sub &&\n-\t\ttest_cmp ../../expect.empty ../../actual.sub &&\n+\t\ttest_must_be_empty ../../actual.sub &&\n \n \t\tgit grep --no-index o >../../actual.sub &&\n \t\ttest_cmp ../../expect.sub ../../actual.sub &&\n@@ -1236,10 +1228,9 @@ test_expect_success !PCRE 'grep -P pattern errors without PCRE' '\n '\n \n test_expect_success 'grep pattern with grep.extendedRegexp=true' '\n-\t>empty &&\n \ttest_must_fail git -c grep.extendedregexp=true \\\n \t\tgrep \"\\p{Ps}.*?\\p{Pe}\" hello.c >actual &&\n-\ttest_cmp empty actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success PCRE 'grep -P pattern with grep.extendedRegexp=true' '\ndiff --git a/t/t7811-grep-open.sh b/t/t7811-grep-open.sh\nindex e1951a5cbb..d1ebfd88c7 100755\n--- a/t/t7811-grep-open.sh\n+++ b/t/t7811-grep-open.sh\n@@ -51,14 +51,13 @@ test_expect_success SIMPLEPAGER 'git grep -O' '\n \tgrep.h\n \tEOF\n \techo grep.h >expect.notless &&\n-\t>empty &&\n \n \tPATH=.:$PATH git grep -O GREP_PATTERN >out &&\n \t{\n \t\ttest_cmp expect.less pager-args ||\n \t\ttest_cmp expect.notless pager-args\n \t} &&\n-\ttest_cmp empty out\n+\ttest_must_be_empty out\n '\n \n test_expect_success 'git grep -O --cached' '\n@@ -72,7 +71,6 @@ test_expect_success 'git grep -O --no-index' '\n \tgrep.h\n \tuntracked\n \tEOF\n-\t>empty &&\n \n \t(\n \t\tGIT_PAGER='\\''printf \"%s\\n\" >pager-args'\\'' &&\n@@ -80,7 +78,7 @@ test_expect_success 'git grep -O --no-index' '\n \t\tgit grep --no-index -O GREP_PATTERN >out\n \t) &&\n \ttest_cmp expect pager-args &&\n-\ttest_cmp empty out\n+\ttest_must_be_empty out\n '\n \n test_expect_success 'setup: fake \"less\"' '\n@@ -96,15 +94,14 @@ test_expect_success 'git grep -O jumps to line in less' '\n \t+/*GREP_PATTERN\n \tgrep.h\n \tEOF\n-\t>empty &&\n \n \tGIT_PAGER=./less git grep -O GREP_PATTERN >out &&\n \ttest_cmp expect actual &&\n-\ttest_cmp empty out &&\n+\ttest_must_be_empty out &&\n \n \tgit grep -O./less GREP_PATTERN >out2 &&\n \ttest_cmp expect actual &&\n-\ttest_cmp empty out2\n+\ttest_must_be_empty out2\n '\n \n test_expect_success 'modified file' '\n@@ -122,7 +119,7 @@ test_expect_success 'modified file' '\n \ttest_when_finished \"git checkout HEAD unrelated\" &&\n \tGIT_PAGER=./less git grep -F -O \"enum grep_pat_token\" >out &&\n \ttest_cmp expect actual &&\n-\ttest_cmp empty out\n+\ttest_must_be_empty out\n '\n \n test_expect_success 'copes with color settings' '\n@@ -138,7 +135,6 @@ test_expect_success 'copes with color settings' '\n test_expect_success 'run from subdir' '\n \trm -f actual &&\n \techo grep.c >expect &&\n-\t>empty &&\n \n \t(\n \t\tcd subdir &&\n@@ -156,8 +152,8 @@ test_expect_success 'run from subdir' '\n \t\t;;\n \tesac &&\n \ttest_cmp expect args &&\n-\ttest_cmp empty out &&\n-\ttest_cmp empty out2\n+\ttest_must_be_empty out &&\n+\ttest_must_be_empty out2\n '\n \n test_done\ndiff --git a/t/t9011-svn-da.sh b/t/t9011-svn-da.sh\nindex b38d16f9db..ab1ef28fd9 100755\n--- a/t/t9011-svn-da.sh\n+++ b/t/t9011-svn-da.sh\n@@ -18,7 +18,7 @@ test_expect_success 'reject empty delta' '\n test_expect_success 'delta can empty file' '\n \tprintf \"SVNQ\" | q_to_nul >clear.delta &&\n \ttest-svn-fe -d preimage clear.delta 4 >actual &&\n-\ttest_cmp empty actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'reject svndiff2' '\n@@ -29,7 +29,7 @@ test_expect_success 'reject svndiff2' '\n test_expect_success 'one-window empty delta' '\n \tprintf \"SVNQ%s\" \"QQQQQ\" | q_to_nul >clear.onewindow &&\n \ttest-svn-fe -d preimage clear.onewindow 9 >actual &&\n-\ttest_cmp empty actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'reject incomplete window header' '\n@@ -50,7 +50,7 @@ test_expect_success 'two-window empty delta' '\n \tprintf \"SVNQ%s%s\" \"QQQQQ\" \"QQQQQ\" | q_to_nul >clear.twowindow &&\n \ttest-svn-fe -d preimage clear.twowindow 14 >actual &&\n \ttest_must_fail test-svn-fe -d preimage clear.twowindow 13 &&\n-\ttest_cmp empty actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'noisy zeroes' '\n@@ -60,7 +60,7 @@ test_expect_success 'noisy zeroes' '\n \t\tq_to_nul >clear.noisy &&\n \tlen=$(wc -c <clear.noisy) &&\n \ttest-svn-fe -d preimage clear.noisy $len &&\n-\ttest_cmp empty actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'reject variable-length int in magic' '\n@@ -83,7 +83,7 @@ test_expect_success 'reject truncated integer' '\n test_expect_success 'nonempty (but unused) preimage view' '\n \tprintf \"SVNQ%b\" \"Q\\003QQQ\" | q_to_nul >clear.readpreimage &&\n \ttest-svn-fe -d preimage clear.readpreimage 9 >actual &&\n-\ttest_cmp empty actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'preimage view: right endpoint cannot backtrack' '\n@@ -99,7 +99,7 @@ test_expect_success 'preimage view: left endpoint can advance' '\n \t\tq_to_nul >clear.shrinkbacktrack &&\n \ttest-svn-fe -d preimage clear.preshrink 14 >actual &&\n \ttest_must_fail test-svn-fe -d preimage clear.shrinkbacktrack 14 &&\n-\ttest_cmp empty actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'preimage view: offsets compared by value' '\n@@ -109,7 +109,7 @@ test_expect_success 'preimage view: offsets compared by value' '\n \t\tq_to_nul >clear.noisyadvance &&\n \ttest_must_fail test-svn-fe -d preimage clear.noisybacktrack 15 &&\n \ttest-svn-fe -d preimage clear.noisyadvance 15 &&\n-\ttest_cmp empty actual\n+\ttest_must_be_empty actual\n '\n \n test_expect_success 'preimage view: reject truncated preimage' '\ndiff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh\nindex 1319415ba8..99d7aa621d 100755\n--- a/t/t9200-git-cvsexportcommit.sh\n+++ b/t/t9200-git-cvsexportcommit.sh\n@@ -43,11 +43,11 @@ check_entries () {\n \tsed -ne '/^\\//p' \"$1/CVS/Entries\" | sort | cut -d/ -f2,3,5 >actual\n \tif test -z \"$2\"\n \tthen\n-\t\t>expected\n+\t\ttest_must_be_empty actual\n \telse\n \t\tprintf '%s\\n' \"$2\" | tr '|' '\\012' >expected\n+\t\ttest_cmp expected actual\n \tfi\n-\ttest_cmp expected actual\n }\n \n test_expect_success \\\ndiff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh\nindex c3b89ae783..056bf1dcda 100755\n--- a/t/t9903-bash-prompt.sh\n+++ b/t/t9903-bash-prompt.sh\n@@ -516,10 +516,9 @@ test_expect_success 'prompt - format string starting with dash' '\n \n test_expect_success 'prompt - pc mode' '\n \tprintf \"BEFORE: (\\${__git_ps1_branch_name}):AFTER\\\\nmaster\" >expected &&\n-\tprintf \"\" >expected_output &&\n \t(\n \t\t__git_ps1 \"BEFORE:\" \":AFTER\" >\"$actual\" &&\n-\t\ttest_cmp expected_output \"$actual\" &&\n+\t\ttest_must_be_empty \"$actual\" &&\n \t\tprintf \"%s\\\\n%s\" \"$PS1\" \"${__git_ps1_branch_name}\" >\"$actual\"\n \t) &&\n \ttest_cmp expected \"$actual\"\n@@ -715,13 +714,12 @@ test_expect_success 'prompt - hide if pwd ignored - env var set, config disabled\n '\n \n test_expect_success 'prompt - hide if pwd ignored - env var set, config unset' '\n-\tprintf \"\" >expected &&\n \t(\n \t\tcd ignored_dir &&\n \t\tGIT_PS1_HIDE_IF_PWD_IGNORED=y &&\n \t\t__git_ps1 >\"$actual\"\n \t) &&\n-\ttest_cmp expected \"$actual\"\n+\ttest_must_be_empty \"$actual\"\n '\n \n test_expect_success 'prompt - hide if pwd ignored - env var set, config unset, pc mode' '\n-- \n2.18.0.903.gab616d7dc6\n\n"},{"id":"356289","messageId":"20180822175201.42406-1-matvore@google.com","threadId":"49165","inReplyTo":"20180819215725.29001-1-szeder.dev@gmail.com","subject":"Re: [PATCH 0/4] tests: make more use of 'test_must_be_empty'","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-08-22T17:52:01Z","receivedAt":"2018-08-22T17:52:06Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"Note that you can also trivially convert a lot more instances of empty\nchecking to the \"right\" way: 'test_line_count = 0'\n\n$ grep -Ir 'test_line_count = 0' t | wc -l\n76\n\nI think it would be nice to clean these up as well.\n\n"}]}