Merge branch 'jk/mbox-from-line' into maint

Some MUAs mangled a line in a message that begins with "From " to
">From " when writing to a mailbox file and feeding such an input to
"git am" used to lose such a line.

* jk/mbox-from-line:
  mailinfo: work around -Wstring-plus-int warning
  mailinfo: make ">From" in-body header check more robust
This commit is contained in:
Junio C Hamano
2014-10-07 13:39:24 -07:00
6 changed files with 66 additions and 1 deletions

View File

@ -89,4 +89,22 @@ test_expect_success 'mailinfo on from header without name works' '
'
test_expect_success 'mailinfo finds headers after embedded From line' '
mkdir embed-from &&
git mailsplit -oembed-from "$TEST_DIRECTORY"/t5100/embed-from.in &&
test_cmp "$TEST_DIRECTORY"/t5100/embed-from.in embed-from/0001 &&
git mailinfo embed-from/msg embed-from/patch \
<embed-from/0001 >embed-from/out &&
test_cmp "$TEST_DIRECTORY"/t5100/embed-from.expect embed-from/out
'
test_expect_success 'mailinfo on message with quoted >From' '
mkdir quoted-from &&
git mailsplit -oquoted-from "$TEST_DIRECTORY"/t5100/quoted-from.in &&
test_cmp "$TEST_DIRECTORY"/t5100/quoted-from.in quoted-from/0001 &&
git mailinfo quoted-from/msg quoted-from/patch \
<quoted-from/0001 >quoted-from/out &&
test_cmp "$TEST_DIRECTORY"/t5100/quoted-from.expect quoted-from/msg
'
test_done

View File

@ -0,0 +1,5 @@
Author: Commit Author
Email: commit@example.com
Subject: patch subject
Date: Sat, 13 Sep 2014 21:13:23 -0400

13
t/t5100/embed-from.in Normal file
View File

@ -0,0 +1,13 @@
From 1234567890123456789012345678901234567890 Mon Sep 17 00:00:00 2001
From: Email Author <email@example.com>
Date: Sun, 25 May 2008 00:38:18 -0700
Subject: [PATCH] email subject
>From 1234567890123456789012345678901234567890 Mon Sep 17 00:00:00 2001
From: Commit Author <commit@example.com>
Date: Sat, 13 Sep 2014 21:13:23 -0400
Subject: patch subject
patch body
---
patch

View File

@ -0,0 +1,3 @@
>From the depths of history, we are stuck with the
flaky mbox format.

10
t/t5100/quoted-from.in Normal file
View File

@ -0,0 +1,10 @@
From 1234567890123456789012345678901234567890 Mon Sep 17 00:00:00 2001
From: Author Name <somebody@example.com>
Date: Sun, 25 May 2008 00:38:18 -0700
Subject: [PATCH] testing quoted >From
>From the depths of history, we are stuck with the
flaky mbox format.
---
patch