Signed-off-by: Miklos Vajna <vmiklos@xxxxxxxxxxxxxx> --- On Sun, Apr 27, 2008 at 01:26:48PM -0700, Junio C Hamano <gitster@xxxxxxxxx> wrote: > Thanks, the idea makes sense. > > Tests? Here it is. (Sorry for the duplication, I forgot to CC the list.) t/t9001-send-email.sh | 66 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 66 insertions(+), 0 deletions(-) diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index c0973b4..af655cf 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -166,4 +166,70 @@ test_expect_success 'second message is patch' ' grep "Subject:.*Second" msgtxt2 ' +cat >expected-show-all-headers <<\EOF +0001-Second.patch +(mbox) Adding cc: A <author@xxxxxxxxxxx> from line 'From: A <author@xxxxxxxxxxx>' +Dry-OK. Log says: +Server: relay.example.com +MAIL FROM:<from@xxxxxxxxxxx> +RCPT TO:<to@xxxxxxxxxxx>,<cc@xxxxxxxxxxx>,<author@xxxxxxxxxxx> +From: Example <from@xxxxxxxxxxx> +To: to@xxxxxxxxxxx +Cc: cc@xxxxxxxxxxx, A <author@xxxxxxxxxxx> +Subject: [PATCH 1/1] Second. +Date: DATE-STRING +Message-Id: MESSAGE-ID-STRING +X-Mailer: X-MAILER-STRING + +Result: OK +EOF + +test_expect_success 'sendemail.cc set' ' + git config sendemail.cc cc@xxxxxxxxxxx && + git send-email \ + --dry-run \ + --from="Example <from@xxxxxxxxxxx>" \ + --to=to@xxxxxxxxxxx \ + --smtp-server relay.example.com \ + $patches | + sed -e "s/^\(Date:\).*/\1 DATE-STRING/" \ + -e "s/^\(Message-Id:\).*/\1 MESSAGE-ID-STRING/" \ + -e "s/^\(X-Mailer:\).*/\1 X-MAILER-STRING/" \ + >actual-show-all-headers && + test_cmp expected-show-all-headers actual-show-all-headers +' + +cat >expected-show-all-headers <<\EOF +0001-Second.patch +(mbox) Adding cc: A <author@xxxxxxxxxxx> from line 'From: A <author@xxxxxxxxxxx>' +Dry-OK. Log says: +Server: relay.example.com +MAIL FROM:<from@xxxxxxxxxxx> +RCPT TO:<to@xxxxxxxxxxx>,<author@xxxxxxxxxxx> +From: Example <from@xxxxxxxxxxx> +To: to@xxxxxxxxxxx +Cc: A <author@xxxxxxxxxxx> +Subject: [PATCH 1/1] Second. +Date: DATE-STRING +Message-Id: MESSAGE-ID-STRING +X-Mailer: X-MAILER-STRING + +Result: OK +EOF + +test_expect_success 'sendemail.cc unset' ' + git config --unset sendemail.cc && + git send-email \ + --dry-run \ + --from="Example <from@xxxxxxxxxxx>" \ + --to=to@xxxxxxxxxxx \ + --smtp-server relay.example.com \ + $patches | + sed -e "s/^\(Date:\).*/\1 DATE-STRING/" \ + -e "s/^\(Message-Id:\).*/\1 MESSAGE-ID-STRING/" \ + -e "s/^\(X-Mailer:\).*/\1 X-MAILER-STRING/" \ + >actual-show-all-headers && + test_cmp expected-show-all-headers actual-show-all-headers +' + test_done -- 1.5.5.1.100.ge64d7 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html