summaryrefslogtreecommitdiff
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorJay Soffian <jaysoffian@gmail.com>2008-02-21 19:16:04 -0500
committerJunio C Hamano <gitster@pobox.com>2008-02-21 21:25:49 -0800
commit0fb7fc751d29cd1099556f71fc7c08158a6a78bc (patch)
tree5168e978572e7f9f73803f1961fd0ab58e2d114e /git-send-email.perl
parentf5ed3b30e0091421408a0119fa75148955c4fc6a (diff)
downloadgit-0fb7fc751d29cd1099556f71fc7c08158a6a78bc.tar.gz
send-email: fix In-Reply-To regression
Fix a regression introduced by 1ca3d6e (send-email: squelch warning due to comparing undefined $_ to "") where if the user was prompted for an initial In-Reply-To and didn't provide one, messages would be sent out with an invalid In-Reply-To of "<>" Also add test cases for the regression and the fix. A small modification was needed to allow send-email to take its replies from stdin if the environment variable GIT_SEND_EMAIL_NOTTY is set. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-xgit-send-email.perl9
1 files changed, 6 insertions, 3 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index ccb87a2d55..29b1105c4c 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -170,7 +170,9 @@ my $envelope_sender;
my $repo = Git->repository();
my $term = eval {
- new Term::ReadLine 'git-send-email';
+ $ENV{"GIT_SEND_EMAIL_NOTTY"}
+ ? new Term::ReadLine 'git-send-email', \*STDIN, \*STDOUT
+ : new Term::ReadLine 'git-send-email';
};
if ($@) {
$term = new FakeTerm "$@: going non-interactive";
@@ -476,8 +478,9 @@ if ($thread && !defined $initial_reply_to && $prompting) {
$initial_reply_to = $_;
}
if (defined $initial_reply_to) {
- $initial_reply_to =~ s/^\s*<?/</;
- $initial_reply_to =~ s/>?\s*$/>/;
+ $initial_reply_to =~ s/^\s*<?//;
+ $initial_reply_to =~ s/>?\s*$//;
+ $initial_reply_to = "<$initial_reply_to>" if $initial_reply_to ne '';
}
if (!defined $smtp_server) {