Skip to content

Commit f74fe34

Browse files
marcowsgitster
authored andcommitted
send-email: fix threaded mails without chain-reply-to
An earlier commit 15da108 ("send-email: 'References:' should only reference what is sent", 2009-04-13) broke logic to set up threading information for the next message by rewriting "!" to "not" without understanding the precedence rules of the language. Namely, ! defined $reply_to || length($reply_to) == 0 was changed to not defined $reply_to || length($reply_to) == 0 which is not (defined $reply_to || length($reply_to) == 0) and different from what was intended, which is (not defined $reply_to) || (length($reply_to) == 0) Signed-off-by: Markus Heidelberg <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d67114a commit f74fe34

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
@@ -1150,7 +1150,8 @@ sub send_message
11501150
my $message_was_sent = send_message();
11511151

11521152
# set up for the next message
1153-
if ($message_was_sent and $chain_reply_to || not defined $reply_to || length($reply_to) == 0) {
1153+
if ($message_was_sent &&
1154+
($chain_reply_to || !defined $reply_to || length($reply_to) == 0)) {
11541155
$reply_to = $message_id;
11551156
if (length $references > 0) {
11561157
$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 'threading but no chain-reply-to' '
624+
test_expect_success 'threading but no chain-reply-to' '
625625
git send-email \
626626
--dry-run \
627627
--from="Example <[email protected]>" \

0 commit comments

Comments
 (0)