mirror of
https://github.com/git/git.git
synced 2024-11-24 10:26:17 +08:00
3aa4d81f88
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>
20 lines
468 B
Bash
Executable File
20 lines
468 B
Bash
Executable File
#!/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
|