diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-03-20 01:03:10 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-03-20 01:03:10 +0300 |
commit | 6f54213718ccd05be8a07f74d0d4e524ebccb3be (patch) | |
tree | 92d0218f9b7f7d4eaa9ecf1c34ad1b6f1fa54777 /t/t7504-commit-msg-hook.sh | |
parent | 950264636c68591989456e3ba0a5442f93152c1a (diff) | |
parent | 9fdc79ecba0f4a3ef885f1409d2db5a1dbabd649 (diff) |
Merge branch 'ab/avoid-losing-exit-codes-in-tests'
Test clean-up.
* ab/avoid-losing-exit-codes-in-tests:
tests: don't lose misc "git" exit codes
tests: don't lose exit status with "test <op> $(git ...)"
tests: don't lose "git" exit codes in "! ( git ... | grep )"
tests: don't lose exit status with "(cd ...; test <op> $(git ...))"
t/lib-patch-mode.sh: fix ignored exit codes
auto-crlf tests: don't lose exit code in loops and outside tests
Diffstat (limited to 't/t7504-commit-msg-hook.sh')
-rwxr-xr-x | t/t7504-commit-msg-hook.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/t/t7504-commit-msg-hook.sh b/t/t7504-commit-msg-hook.sh index 07ca46fb0d..d1255228d5 100755 --- a/t/t7504-commit-msg-hook.sh +++ b/t/t7504-commit-msg-hook.sh @@ -102,7 +102,9 @@ test_expect_success 'setup: commit-msg hook that always fails' ' ' commit_msg_is () { - test "$(git log --pretty=format:%s%b -1)" = "$1" + printf "%s" "$1" >expect && + git log --pretty=format:%s%b -1 >actual && + test_cmp expect actual } test_expect_success 'with failing hook' ' |