Merge branch 'ab/send-email-validate-errors-fix'

* ab/send-email-validate-errors-fix:
  send-email: fix missing error message regression
This commit is contained in:
Junio C Hamano
2021-05-25 16:21:19 +09:00
2 changed files with 32 additions and 3 deletions

View File

@ -644,14 +644,33 @@ test_expect_success $PREREQ 'In-Reply-To with --chain-reply-to' '
test_cmp expect actual
'
test_set_editor "$(pwd)/fake-editor"
test_expect_success $PREREQ 'setup erroring fake editor' '
write_script fake-editor <<-\EOF
echo >&2 "I am about to error"
exit 1
EOF
'
test_expect_success $PREREQ 'fake editor dies with error' '
clean_fake_sendmail &&
test_must_fail git send-email \
--compose --subject foo \
--from="Example <nobody@example.com>" \
--to=nobody@example.com \
--smtp-server="$(pwd)/fake.sendmail" \
$patches 2>err &&
grep "I am about to error" err &&
grep "the editor exited uncleanly, aborting everything" err
'
test_expect_success $PREREQ 'setup fake editor' '
write_script fake-editor <<-\EOF
echo fake edit >>"$1"
EOF
'
test_set_editor "$(pwd)/fake-editor"
test_expect_success $PREREQ '--compose works' '
clean_fake_sendmail &&
git send-email \