Skip to content

Commit 5e9758e

Browse files
marcowsgitster
authored andcommitted
send-email: fix non-threaded mails
After commit 3e0c4ff (send-email: respect in-reply-to regardless of threading, 2009-03-01) the variable $thread was only used for prompting for an "In-Reply-To", but not for controlling whether the "In-Reply-To" and "References" fields should be written into the email. Thus these fields were always used beginning with the second mail and it was not possible to produce non-threaded mails anymore. However, a later commit 15da108 ("send-email: 'References:' should only reference what is sent", 2009-04-13) introduced a regression with the side effect to make non-threaded mails possible again, but only when --no-chain-reply-to was used. Signed-off-by: Markus Heidelberg <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 32ae831 commit 5e9758e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

git-send-email.perl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,8 @@ sub send_message
11371137
send_message();
11381138

11391139
# set up for the next message
1140-
if ($chain_reply_to || !defined $reply_to || length($reply_to) == 0) {
1140+
if ($thread &&
1141+
($chain_reply_to || !defined $reply_to || length($reply_to) == 0)) {
11411142
$reply_to = $message_id;
11421143
if (length $references > 0) {
11431144
$references .= "\n $message_id";

t/t9001-send-email.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ test_expect_success 'in-reply-to but no threading' '
621621
grep "In-Reply-To: <[email protected]>"
622622
'
623623

624-
test_expect_failure 'no in-reply-to and no threading' '
624+
test_expect_success 'no in-reply-to and no threading' '
625625
git send-email \
626626
--dry-run \
627627
--from="Example <[email protected]>" \

0 commit comments

Comments
 (0)