{"thread":{"id":"38520","subject":"[PATCH 2/3] trailer: add tests for trailer.trimEmpty","startedAt":"2015-02-07T13:11:10Z","lastAt":"2015-02-07T13:11:10Z","messageCount":1,"participants":["Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"255693","messageId":"20150207131112.394.64847.chriscool@tuxfamily.org","threadId":"38520","inReplyTo":null,"subject":"[PATCH 2/3] trailer: add tests for trailer.trimEmpty","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2015-02-07T13:11:10Z","receivedAt":"2015-02-07T13:11:10Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n t/t7513-interpret-trailers.sh | 72 +++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 72 insertions(+)\n\ndiff --git a/t/t7513-interpret-trailers.sh b/t/t7513-interpret-trailers.sh\nindex bd0ab46..066d00b 100755\n--- a/t/t7513-interpret-trailers.sh\n+++ b/t/t7513-interpret-trailers.sh\n@@ -892,4 +892,76 @@ test_expect_success 'with no command and no key' '\n \ttest_cmp expected actual\n '\n \n+test_expect_success 'with trailer.trimEmpty set to true' '\n+\tgit config trailer.trimEmpty true &&\n+\tcat >expected <<-EOF &&\n+\n+\t\tsign: A U Thor <author@example.com>\n+\t\tThanks-to: Johannes\n+\tEOF\n+\tgit interpret-trailers --trailer \"review:\" \\\n+\t\t--trailer \"Thanks-to:Johannes\" >actual <<-EOF\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'with trailer.trimEmpty set to false' '\n+\tgit config trailer.trimEmpty false &&\n+\tsed -e \"s/ Z\\$/ /\" >expected <<-EOF &&\n+\n+\t\treview: Z\n+\t\tsign: A U Thor <author@example.com>\n+\t\tThanks-to: Johannes\n+\tEOF\n+\tgit interpret-trailers --trailer \"review:\" \\\n+\t\t--trailer \"Thanks-to:Johannes\" >actual <<-EOF\n+\tEOF\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'with trailer.trimEmpty set to false and a message' '\n+\tcat complex_message_body >expected &&\n+\tsed -e \"s/ Z\\$/ /\" >>expected <<-\\EOF &&\n+\t\tFixes: Z\n+\t\tAcked-by= Z\n+\t\tReviewed-by: Z\n+\t\tSigned-off-by: Z\n+\t\tsign: A U Thor <author@example.com>\n+\t\tThanks-to: Johannes\n+\tEOF\n+\tgit interpret-trailers --trailer \"review:\" \\\n+\t\t--trailer \"Thanks-to:Johannes\" complex_message >actual\n+\ttest_cmp expected actual &&\n+\tgit interpret-trailers --no-trim-empty --trailer \"review:\" \\\n+\t\t--trailer \"Thanks-to:Johannes\" complex_message >actual\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'with trailer.trimEmpty set to 1 and a message' '\n+\tgit config trailer.trimEmpty 1 &&\n+\tcat complex_message_body >expected &&\n+\tsed -e \"s/ Z\\$/ /\" >>expected <<-\\EOF &&\n+\t\tsign: A U Thor <author@example.com>\n+\t\tThanks-to: Johannes\n+\tEOF\n+\tgit interpret-trailers --trailer \"review:\" \\\n+\t\t--trailer \"Thanks-to:Johannes\" complex_message >actual\n+\ttest_cmp expected actual\n+'\n+\n+test_expect_success 'with trailer.trimEmpty set to 1 and --no-trim-empty' '\n+\tcat complex_message_body >expected &&\n+\tsed -e \"s/ Z\\$/ /\" >>expected <<-\\EOF &&\n+\t\tFixes: Z\n+\t\tAcked-by= Z\n+\t\tReviewed-by: Z\n+\t\tSigned-off-by: Z\n+\t\tsign: A U Thor <author@example.com>\n+\t\tThanks-to: Johannes\n+\tEOF\n+\tgit interpret-trailers --no-trim-empty --trailer \"review:\" \\\n+\t\t--trailer \"Thanks-to:Johannes\" complex_message >actual\n+\ttest_cmp expected actual\n+'\n+\n test_done\n-- \n2.2.1.313.gcc831f2\n"}]}