Skip to content

Commit

Permalink
Merge branch 'fc/send-email-no-sender-prompt'
Browse files Browse the repository at this point in the history
* fc/send-email-no-sender-prompt:
  send-email: avoid questions when user has an ident
  • Loading branch information
Junio C Hamano committed Nov 29, 2012
2 parents 03a23a4 + 8cac13d commit 175bd3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
7 changes: 1 addition & 6 deletions git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -753,16 +753,11 @@ sub file_declares_8bit_cte {
}
}

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

my $prompting = 0;
if (!@initial_to && !defined $to_cmd) {
my $to = ask("Who should the emails be sent to (if any)? ",
default => "",
Expand Down
5 changes: 2 additions & 3 deletions t/t9001-send-email.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,13 @@ test_expect_success $PREREQ 'Show all headers' '

test_expect_success $PREREQ 'Prompting works' '
clean_fake_sendmail &&
(echo "Example <from@example.com>"
echo "to@example.com"
(echo "to@example.com"
echo ""
) | GIT_SEND_EMAIL_NOTTY=1 git send-email \
--smtp-server="$(pwd)/fake.sendmail" \
$patches \
2>errors &&
grep "^From: Example <from@example.com>\$" msgtxt1 &&
grep "^From: A U Thor <author@example.com>\$" msgtxt1 &&
grep "^To: to@example.com\$" msgtxt1
'

Expand Down

0 comments on commit 175bd3b

Please sign in to comment.