Merge branch 'cw/diff-highlight'
[gitweb.git] / t / t9001-send-email.sh
index 1ef1a19003db5c9be94197e9d6cb25110591705b..1e3ac3c3846342ac84baa096ab00ed602e4cdf27 100755 (executable)
@@ -481,6 +481,20 @@ test_expect_success $PREREQ 'long lines with auto encoding are quoted-printable'
        grep "Content-Transfer-Encoding: quoted-printable" msgtxt1
 '
 
+test_expect_success $PREREQ 'carriage returns with auto encoding are quoted-printable' '
+       clean_fake_sendmail &&
+       cp $patches cr.patch &&
+       printf "this is a line\r\n" >>cr.patch &&
+       git send-email \
+               --from="Example <nobody@example.com>" \
+               --to=nobody@example.com \
+               --smtp-server="$(pwd)/fake.sendmail" \
+               --transfer-encoding=auto \
+               --no-validate \
+               cr.patch &&
+       grep "Content-Transfer-Encoding: quoted-printable" msgtxt1
+'
+
 for enc in auto quoted-printable base64
 do
        test_expect_success $PREREQ "--validate passes with encoding $enc" '
@@ -492,6 +506,21 @@ do
                        --validate \
                        $patches longline.patch
        '
+
+done
+
+for enc in 7bit 8bit quoted-printable base64
+do
+       test_expect_success $PREREQ "--transfer-encoding=$enc produces correct header" '
+               clean_fake_sendmail &&
+               git send-email \
+                       --from="Example <nobody@example.com>" \
+                       --to=nobody@example.com \
+                       --smtp-server="$(pwd)/fake.sendmail" \
+                       --transfer-encoding=$enc \
+                       $patches &&
+               grep "Content-Transfer-Encoding: $enc" msgtxt1
+       '
 done
 
 test_expect_success $PREREQ 'Invalid In-Reply-To' '