From: Junio C Hamano Date: Tue, 12 Oct 2021 20:51:43 +0000 (-0700) Subject: Merge branch 'mh/send-email-reset-in-reply-to' into maint X-Git-Tag: v2.33.1~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f11b01bdd5c9c4c3d1ee83dcec5845c827bcb1f8;p=thirdparty%2Fgit.git Merge branch 'mh/send-email-reset-in-reply-to' into maint 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 --- f11b01bdd5c9c4c3d1ee83dcec5845c827bcb1f8 diff --cc t/t9001-send-email.sh index 595cbad372,35be6b0190..9022074474 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@@ -2196,37 -2097,51 +2196,82 @@@ test_expect_success $PREREQ 'leading an test_cmp expected-list actual-list ' +test_expect_success $PREREQ 'test using command name with --sendmail-cmd' ' + clean_fake_sendmail && + PATH="$PWD:$PATH" \ + git send-email \ + --from="Example " \ + --to=nobody@example.com \ + --sendmail-cmd="fake.sendmail" \ + HEAD^ && + test_path_is_file commandline1 +' + +test_expect_success $PREREQ 'test using arguments with --sendmail-cmd' ' + clean_fake_sendmail && + git send-email \ + --from="Example " \ + --to=nobody@example.com \ + --sendmail-cmd='\''"$(pwd)/fake.sendmail" -f nobody@example.com'\'' \ + HEAD^ && + test_path_is_file commandline1 +' + +test_expect_success $PREREQ 'test shell expression with --sendmail-cmd' ' + clean_fake_sendmail && + git send-email \ + --from="Example " \ + --to=nobody@example.com \ + --sendmail-cmd='\''f() { "$(pwd)/fake.sendmail" "$@"; };f'\'' \ + HEAD^ && + 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 + Subject: patch with in-reply-to + Message-ID: + In-Reply-To: + References: + + This is the body. + EOF + cat >no-reply.patch <<-\EOF + From: A U Thor + Subject: patch without in-reply-to + Message-ID: + + 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: " msgtxt1 && + grep "References: " 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="" \ + --to=nobody@example.com \ + --smtp-server="$(pwd)/fake.sendmail" \ + has-reply.patch no-reply.patch && + grep "In-Reply-To: " msgtxt1 && + grep "References: " msgtxt1 && + grep "In-Reply-To: " msgtxt2 && + grep "References: " msgtxt2 + ' + test_expect_success $PREREQ 'invoke hook' ' mkdir -p .git/hooks &&