summaryrefslogtreecommitdiff
path: root/t/t9001-send-email.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-09-10 18:46:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-09-10 18:46:25 (GMT)
commitbd29bcf9136c6cb96dba3bb79c532b3b215fb9d8 (patch)
tree8946be40a1592063893e9ea2afda9a5da39c591e /t/t9001-send-email.sh
parent0538a2586e7c4d9fd5ec6ecdc4cf04101ee73a6b (diff)
parente0821134846b10952efc0737b9e32ca8226f0a4d (diff)
downloadgit-bd29bcf9136c6cb96dba3bb79c532b3b215fb9d8.zip
git-bd29bcf9136c6cb96dba3bb79c532b3b215fb9d8.tar.gz
git-bd29bcf9136c6cb96dba3bb79c532b3b215fb9d8.tar.bz2
Merge branch 'mh/send-email-reset-in-reply-to'
Even when running "git send-email" without its own threaded discussion support, a threading related header in one message is carried over to the subsequent message to result in an unwanted threading, which has been corrected. * mh/send-email-reset-in-reply-to: send-email: avoid incorrect header propagation
Diffstat (limited to 't/t9001-send-email.sh')
-rwxr-xr-xt/t9001-send-email.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 595cbad..9022074 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -2227,6 +2227,51 @@ test_expect_success $PREREQ 'test shell expression with --sendmail-cmd' '
test_path_is_file commandline1
'
+test_expect_success $PREREQ 'set up in-reply-to/references patches' '
+ cat >has-reply.patch <<-\EOF &&
+ From: A U Thor <author@example.com>
+ Subject: patch with in-reply-to
+ Message-ID: <patch.with.in.reply.to@example.com>
+ In-Reply-To: <replied.to@example.com>
+ References: <replied.to@example.com>
+
+ This is the body.
+ EOF
+ cat >no-reply.patch <<-\EOF
+ From: A U Thor <author@example.com>
+ Subject: patch without in-reply-to
+ Message-ID: <patch.without.in.reply.to@example.com>
+
+ This is the body.
+ EOF
+'
+
+test_expect_success $PREREQ 'patch reply headers correct with --no-thread' '
+ clean_fake_sendmail &&
+ git send-email \
+ --no-thread \
+ --to=nobody@example.com \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ has-reply.patch no-reply.patch &&
+ grep "In-Reply-To: <replied.to@example.com>" msgtxt1 &&
+ grep "References: <replied.to@example.com>" msgtxt1 &&
+ ! grep replied.to@example.com msgtxt2
+'
+
+test_expect_success $PREREQ 'cmdline in-reply-to used with --no-thread' '
+ clean_fake_sendmail &&
+ git send-email \
+ --no-thread \
+ --in-reply-to="<cmdline.reply@example.com>" \
+ --to=nobody@example.com \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ has-reply.patch no-reply.patch &&
+ grep "In-Reply-To: <cmdline.reply@example.com>" msgtxt1 &&
+ grep "References: <cmdline.reply@example.com>" msgtxt1 &&
+ grep "In-Reply-To: <cmdline.reply@example.com>" msgtxt2 &&
+ grep "References: <cmdline.reply@example.com>" msgtxt2
+'
+
test_expect_success $PREREQ 'invoke hook' '
mkdir -p .git/hooks &&