Skip to content

Commit 175bd3b

Browse files
committed
Merge branch 'fc/send-email-no-sender-prompt'
* fc/send-email-no-sender-prompt: send-email: avoid questions when user has an ident
2 parents 03a23a4 + 8cac13d commit 175bd3b

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

git-send-email.perl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -753,16 +753,11 @@ sub file_declares_8bit_cte {
753753
}
754754
}
755755

756-
my $prompting = 0;
757756
if (!defined $sender) {
758757
$sender = $repoauthor || $repocommitter || '';
759-
$sender = ask("Who should the emails appear to be from? [$sender] ",
760-
default => $sender,
761-
valid_re => qr/\@.*\./, confirm_only => 1);
762-
print "Emails will be sent from: ", $sender, "\n";
763-
$prompting++;
764758
}
765759

760+
my $prompting = 0;
766761
if (!@initial_to && !defined $to_cmd) {
767762
my $to = ask("Who should the emails be sent to (if any)? ",
768763
default => "",

t/t9001-send-email.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,13 @@ test_expect_success $PREREQ 'Show all headers' '
191191

192192
test_expect_success $PREREQ 'Prompting works' '
193193
clean_fake_sendmail &&
194-
(echo "Example <[email protected]>"
195-
194+
196195
echo ""
197196
) | GIT_SEND_EMAIL_NOTTY=1 git send-email \
198197
--smtp-server="$(pwd)/fake.sendmail" \
199198
$patches \
200199
2>errors &&
201-
grep "^From: Example <from@example.com>\$" msgtxt1 &&
200+
grep "^From: A U Thor <author@example.com>\$" msgtxt1 &&
202201
grep "^To: [email protected]\$" msgtxt1
203202
'
204203

0 commit comments

Comments
 (0)