{"thread":{"id":"26560","subject":"[PATCH] t/t7500-commit.sh: use test_cmp instead of test","startedAt":"2011-02-19T18:29:09Z","lastAt":"2011-02-19T18:29:09Z","messageCount":1,"participants":["Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"161639","messageId":"1298140149-13652-1-git-send-email-avarab@gmail.com","threadId":"26560","inReplyTo":null,"subject":"[PATCH] t/t7500-commit.sh: use test_cmp instead of test","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-19T18:29:09Z","receivedAt":"2011-02-19T18:29:09Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change commit_msg_is() in t/t7500-commit.sh to use test_cmp instead of\nthe shell's test function. Now if a test fails we'll get test_cmp\noutput showing us what failed.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t7500-commit.sh |    7 ++++++-\n 1 files changed, 6 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t7500-commit.sh b/t/t7500-commit.sh\nindex 162527c..d551b77 100755\n--- a/t/t7500-commit.sh\n+++ b/t/t7500-commit.sh\n@@ -10,7 +10,12 @@ Tests for selected commit options.'\n . ./test-lib.sh\n \n commit_msg_is () {\n-\ttest \"`git log --pretty=format:%s%b -1`\" = \"$1\"\n+\texpect=commit_msg_is.expect\n+\tactual=commit_msg_is.actual\n+\n+\tprintf \"%s\" \"$(git log --pretty=format:%s%b -1)\" >$expect &&\n+\tprintf \"%s\" \"$1\" >$actual &&\n+\ttest_cmp $expect $actual\n }\n \n # A sanity check to see if commit is working at all.\n-- \n1.7.2.3\n"}]}