Skip to content

Commit 59defcc

Browse files
peffgitster
authored andcommitted
t9001: check send-email behavior with implicit sender
We allow send-email to use an implicitly-defined identity for the sender (because there is still a confirmation step), but we abort when we cannot generate such an identity. Let's make sure that we test this. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3b16b37 commit 59defcc

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

t/t9001-send-email.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,34 @@ test_expect_success $PREREQ 'Prompting works' '
201201
grep "^To: [email protected]\$" msgtxt1
202202
'
203203

204+
test_expect_success $PREREQ,AUTOIDENT 'implicit ident is allowed' '
205+
clean_fake_sendmail &&
206+
(sane_unset GIT_AUTHOR_NAME &&
207+
sane_unset GIT_AUTHOR_EMAIL &&
208+
sane_unset GIT_COMMITTER_NAME &&
209+
sane_unset GIT_COMMITTER_EMAIL &&
210+
GIT_SEND_EMAIL_NOTTY=1 git send-email \
211+
--smtp-server="$(pwd)/fake.sendmail" \
212+
213+
$patches </dev/null 2>errors
214+
)
215+
'
216+
217+
test_expect_success $PREREQ,!AUTOIDENT 'broken implicit ident aborts send-email' '
218+
clean_fake_sendmail &&
219+
(sane_unset GIT_AUTHOR_NAME &&
220+
sane_unset GIT_AUTHOR_EMAIL &&
221+
sane_unset GIT_COMMITTER_NAME &&
222+
sane_unset GIT_COMMITTER_EMAIL &&
223+
GIT_SEND_EMAIL_NOTTY=1 && export GIT_SEND_EMAIL_NOTTY &&
224+
test_must_fail git send-email \
225+
--smtp-server="$(pwd)/fake.sendmail" \
226+
227+
$patches </dev/null 2>errors &&
228+
test_i18ngrep "tell me who you are" errors
229+
)
230+
'
231+
204232
test_expect_success $PREREQ 'tocmd works' '
205233
clean_fake_sendmail &&
206234
cp $patches tocmd.patch &&

0 commit comments

Comments
 (0)