trailer: add test with an old style conflict block
authorChristian Couder <chriscool@tuxfamily.org>
Sun, 9 Nov 2014 09:23:43 +0000 (10:23 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Nov 2014 18:00:07 +0000 (10:00 -0800)
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7513-interpret-trailers.sh
index fed053a7ecb99c6cb4f18e8336e1d97154c624c4..bd0ab4675089b54c336ccc9590c4b65bbd37138d 100755 (executable)
@@ -213,7 +213,7 @@ test_expect_success 'with 2 files arguments' '
 '
 
 test_expect_success 'with message that has comments' '
-       cat basic_message >>message_with_comments &&
+       cat basic_message >message_with_comments &&
        sed -e "s/ Z\$/ /" >>message_with_comments <<-\EOF &&
                # comment
 
@@ -240,6 +240,36 @@ test_expect_success 'with message that has comments' '
        test_cmp expected actual
 '
 
+test_expect_success 'with message that has an old style conflict block' '
+       cat basic_message >message_with_comments &&
+       sed -e "s/ Z\$/ /" >>message_with_comments <<-\EOF &&
+               # comment
+
+               # other comment
+               Cc: Z
+               # yet another comment
+               Reviewed-by: Johan
+               Reviewed-by: Z
+               # last comment
+
+               Conflicts:
+
+       EOF
+       cat basic_message >expected &&
+       cat >>expected <<-\EOF &&
+               # comment
+
+               Reviewed-by: Johan
+               Cc: Peff
+               # last comment
+
+               Conflicts:
+
+       EOF
+       git interpret-trailers --trim-empty --trailer "Cc: Peff" message_with_comments >actual &&
+       test_cmp expected actual
+'
+
 test_expect_success 'with commit complex message and trailer args' '
        cat complex_message_body >expected &&
        sed -e "s/ Z\$/ /" >>expected <<-\EOF &&