1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-05 16:26:12 +02:00

git-send-email: do not drop custom headers the user prepared

The command picked up only Subject, CC, and From headers in the
incoming mbox text.  Sending out patches prepared by
git-format-patch with user's custom headers was impossible with
that.

Just keep the ones it does not need to look at and add them to
the header of the message when sending it out.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2006-10-05 16:36:49 -07:00
parent abd6970aca
commit ce91c2f653

View File

@ -83,7 +83,7 @@ sub format_2822_time {
my $compose_filename = ".msg.$$";
# Variables we fill in automatically, or via prompting:
my (@to,@cc,@initial_cc,@bcclist,
my (@to,@cc,@initial_cc,@bcclist,@xh,
$initial_reply_to,$initial_subject,@files,$from,$compose,$time);
# Behavior modification variables
@ -422,6 +422,9 @@ sub send_message
$header .= "In-Reply-To: $reply_to\n";
$header .= "References: $references\n";
}
if (@xh) {
$header .= join("\n", @xh) . "\n";
}
if ($smtp_server =~ m#^/#) {
my $pid = open my $sm, '|-';
@ -472,6 +475,7 @@ sub send_message
my $author_not_sender = undef;
@cc = @initial_cc;
@xh = ();
my $found_mbox = 0;
my $header_done = 0;
$message = "";
@ -495,6 +499,9 @@ sub send_message
$2, $_) unless $quiet;
push @cc, $2;
}
elsif (/^[-A-Za-z]+:\s+\S/) {
push @xh, $_;
}
} else {
# In the traditional