From 959a26231f53b9cc7da40d36c550aef193647731 Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Tue, 12 Feb 2013 02:17:39 -0800 Subject: Unify appending signoff in format-patch, commit and sequencer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are two implementations of append_signoff in log-tree.c and sequencer.c, which do more or less the same thing. Unify on top of the sequencer.c implementation. Add a test in t4014 to demonstrate support for non-s-o-b elements in the commit footer provided by sequence.c:append_sob. Mark tests fixed as appropriate. [Commit message mostly stolen from Nguyễn Thái Ngọc Duy's original unification patch] Signed-off-by: Brandon Casey Signed-off-by: Junio C Hamano --- t/t4014-format-patch.sh | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 't') diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 0ed899f0f2..95af73f596 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -1045,7 +1045,28 @@ EOF test_cmp expected actual ' -test_expect_failure 'signoff: some random signoff-alike' ' +test_expect_success 'signoff: misc conforming footer elements' ' + append_signoff <<\EOF >actual && +subject + +body + +Signed-off-by: my@house +(cherry picked from commit da39a3ee5e6b4b0d3255bfef95601890afd80709) +Tested-by: Some One +Bug: 1234 +EOF + cat >expected <<\EOF && +4:Subject: [PATCH] subject +8: +10: +11:Signed-off-by: my@house +15:Signed-off-by: C O Mitter +EOF + test_cmp expected actual +' + +test_expect_success 'signoff: some random signoff-alike' ' append_signoff <<\EOF >actual && subject @@ -1061,7 +1082,7 @@ EOF test_cmp expected actual ' -test_expect_failure 'signoff: not really a signoff' ' +test_expect_success 'signoff: not really a signoff' ' append_signoff <<\EOF >actual && subject @@ -1077,7 +1098,7 @@ EOF test_cmp expected actual ' -test_expect_failure 'signoff: not really a signoff (2)' ' +test_expect_success 'signoff: not really a signoff (2)' ' append_signoff <<\EOF >actual && subject @@ -1094,7 +1115,7 @@ EOF test_cmp expected actual ' -test_expect_failure 'signoff: valid S-o-b paragraph in the middle' ' +test_expect_success 'signoff: valid S-o-b paragraph in the middle' ' append_signoff <<\EOF >actual && subject @@ -1162,7 +1183,7 @@ EOF test_cmp expected actual ' -test_expect_failure 'signoff: detect garbage in non-conforming footer' ' +test_expect_success 'signoff: detect garbage in non-conforming footer' ' append_signoff <<\EOF >actual && subject -- cgit v1.2.1