diff options
author | René Scharfe <l.s.r@web.de> | 2018-08-26 00:50:32 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-08-29 23:05:35 +0300 |
commit | 3aa4d81f88d2f09173e65eebe35a385b2a064c87 (patch) | |
tree | 2320c740c2b723593d1d871adda8a7b2f3cd75f3 /t/t4256-am-format-flowed.sh | |
parent | 53f9a3e157dbbc901a02ac2c73346d375e24978c (diff) |
mailinfo: support format=flowed
Add best-effort support for patches sent using format=flowed (RFC 3676).
Remove leading spaces ("unstuff"), remove soft line breaks (indicated
by space + newline), but leave the signature separator (dash dash space
newline) alone.
Warn in git am when encountering a format=flowed patch, because any
trailing spaces would most probably be lost, as the sending MUA is
encouraged to remove them when preparing the email.
Provide a test patch formatted by Mozilla Thunderbird 60 using its
default configuration. It reuses the contents of the file mailinfo.c
before and after this patch.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4256-am-format-flowed.sh')
-rwxr-xr-x | t/t4256-am-format-flowed.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t4256-am-format-flowed.sh b/t/t4256-am-format-flowed.sh new file mode 100755 index 0000000000..6340310e9a --- /dev/null +++ b/t/t4256-am-format-flowed.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +test_description='test format=flowed support of git am' + +. ./test-lib.sh + +test_expect_success 'setup' ' + cp "$TEST_DIRECTORY/t4256/1/mailinfo.c.orig" mailinfo.c && + git add mailinfo.c && + git commit -m initial +' + +test_expect_success 'am with format=flowed' ' + git am <"$TEST_DIRECTORY/t4256/1/patch" >stdout 2>stderr && + test_i18ngrep "warning: Patch sent with format=flowed" stderr && + test_cmp "$TEST_DIRECTORY/t4256/1/mailinfo.c" mailinfo.c +' + +test_done |