git am/mailinfo: Don't look at in-body headers when rebasing

When we are rebasing we know that the header lines in the
patch are good and that we don't need to pick up any headers
from the body of the patch.

This makes it possible to rebase commits whose commit message
start with "From" or "Date".

Test vectors by Jeff King.

Signed-off-by: Lukas Sandström <luksan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Lukas Sandström
2009-11-20 17:12:47 +01:00
committed by Junio C Hamano
parent 78d553b7d7
commit d25e51596b
16 changed files with 122 additions and 5 deletions

View File

@ -650,3 +650,36 @@ index b0b5d8f..461c47e 100644
convert_to_utf8(line, charset.buf);
--
1.6.4.1
From nobody Mon Sep 17 00:00:00 2001
From: A U Thor <a.u.thor@example.com>
Subject: check bogus body header (from)
Date: Fri, 9 Jun 2006 00:44:16 -0700
From: bogosity
- a list
- of stuff
---
diff --git a/foo b/foo
index e69de29..d95f3ad 100644
--- a/foo
+++ b/foo
@@ -0,0 +1 @@
+content
From nobody Mon Sep 17 00:00:00 2001
From: A U Thor <a.u.thor@example.com>
Subject: check bogus body header (date)
Date: Fri, 9 Jun 2006 00:44:16 -0700
Date: bogus
and some content
---
diff --git a/foo b/foo
index e69de29..d95f3ad 100644
--- a/foo
+++ b/foo
@@ -0,0 +1 @@
+content