diff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh index c1008361a5..1cc382dc8b 100755 --- a/t/t3800-mktag.sh +++ b/t/t3800-mktag.sh @@ -14,7 +14,8 @@ test_description='git mktag: tag object verify test' check_verify_failure () { expect="$2" test_expect_success "$1" ' - test_must_fail git mktag message && + test_must_fail env GIT_TEST_GETTEXT_POISON=false \ + git mktag message && grep "$expect" message ' } @@ -136,7 +137,29 @@ check_verify_failure '"type" line type-name length check' \ '^error: char.*: type too long$' ############################################################ -# 9. verify object (SHA1/type) check +# 9. verify object (hash/type) check + +cat >tag.sig < 0 +0000 + +EOF + +check_verify_failure 'verify object (hash/type) check -- correct type, nonexisting object' \ + '^error: char7: could not verify object.*$' + +cat >tag.sig < 0 +0000 + +EOF + +check_verify_failure 'verify object (hash/type) check -- made-up type, valid object' \ + '^fatal: invalid object type' cat >tag.sig < 0 +0000 EOF -check_verify_failure 'verify object (SHA1/type) check' \ +check_verify_failure 'verify object (hash/type) check -- made-up type, nonexisting object' \ '^error: char7: could not verify object.*$' +cat >tag.sig < 0 +0000 + +EOF + +check_verify_failure 'verify object (hash/type) check -- mismatched type, valid object' \ + '^error: char7: could not verify object' + ############################################################ # 10. verify tag-name check