aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Heidelberg <markus.heidelberg@web.de>2009-06-12 12:51:38 +0200
committerJunio C Hamano <gitster@pobox.com>2009-06-12 09:20:21 -0700
commit5e9758e2968238906c730c9c77ecc95c21e7495e (patch)
tree9bf676400098435b71b406faeda436df2d7c8f3f
parent32ae83194b0f287a9b6644cdad175c56417c31f3 (diff)
downloadgit-5e9758e2968238906c730c9c77ecc95c21e7495e.tar.gz
git-5e9758e2968238906c730c9c77ecc95c21e7495e.tar.xz
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 <markus.heidelberg@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xgit-send-email.perl3
-rwxr-xr-xt/t9001-send-email.sh2
2 files changed, 3 insertions, 2 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index cccbf4517..5d5169707 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1137,7 +1137,8 @@ foreach my $t (@files) {
send_message();
# set up for the next message
- if ($chain_reply_to || !defined $reply_to || length($reply_to) == 0) {
+ if ($thread &&
+ ($chain_reply_to || !defined $reply_to || length($reply_to) == 0)) {
$reply_to = $message_id;
if (length $references > 0) {
$references .= "\n $message_id";
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 5bfa36ecc..8518acaca 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -621,7 +621,7 @@ test_expect_success 'in-reply-to but no threading' '
grep "In-Reply-To: <in-reply-id@example.com>"
'
-test_expect_failure 'no in-reply-to and no threading' '
+test_expect_success 'no in-reply-to and no threading' '
git send-email \
--dry-run \
--from="Example <nobody@example.com>" \