зеркало из https://github.com/microsoft/git.git
Merge branch 'fc/send-email-no-sender-prompt' into jk/send-email-sender-prompt
* fc/send-email-no-sender-prompt: send-email: avoid questions when user has an ident
This commit is contained in:
Коммит
3b16b3702a
|
@ -753,16 +753,11 @@ if (!$force) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my $prompting = 0;
|
|
||||||
if (!defined $sender) {
|
if (!defined $sender) {
|
||||||
$sender = $repoauthor || $repocommitter || '';
|
$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) {
|
if (!@initial_to && !defined $to_cmd) {
|
||||||
my $to = ask("Who should the emails be sent to (if any)? ",
|
my $to = ask("Who should the emails be sent to (if any)? ",
|
||||||
default => "",
|
default => "",
|
||||||
|
|
|
@ -191,14 +191,13 @@ test_expect_success $PREREQ 'Show all headers' '
|
||||||
|
|
||||||
test_expect_success $PREREQ 'Prompting works' '
|
test_expect_success $PREREQ 'Prompting works' '
|
||||||
clean_fake_sendmail &&
|
clean_fake_sendmail &&
|
||||||
(echo "Example <from@example.com>"
|
(echo "to@example.com"
|
||||||
echo "to@example.com"
|
|
||||||
echo ""
|
echo ""
|
||||||
) | GIT_SEND_EMAIL_NOTTY=1 git send-email \
|
) | GIT_SEND_EMAIL_NOTTY=1 git send-email \
|
||||||
--smtp-server="$(pwd)/fake.sendmail" \
|
--smtp-server="$(pwd)/fake.sendmail" \
|
||||||
$patches \
|
$patches \
|
||||||
2>errors &&
|
2>errors &&
|
||||||
grep "^From: Example <from@example.com>\$" msgtxt1 &&
|
grep "^From: A U Thor <author@example.com>\$" msgtxt1 &&
|
||||||
grep "^To: to@example.com\$" msgtxt1
|
grep "^To: to@example.com\$" msgtxt1
|
||||||
'
|
'
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче