Merge branch 'jc/add-u-A-default-to-top' into maint
[gitweb.git] / t / t7513-interpret-trailers.sh
index bd0ab4675089b54c336ccc9590c4b65bbd37138d..322c436a494c14a7350d6fdd85efbfbc5a7a8d28 100755 (executable)
@@ -93,12 +93,39 @@ test_expect_success 'with config option on the command line' '
                Acked-by: Johan
                Reviewed-by: Peff
        EOF
-       echo "Acked-by: Johan" |
+       { echo; echo "Acked-by: Johan"; } |
        git -c "trailer.Acked-by.ifexists=addifdifferent" interpret-trailers \
                --trailer "Reviewed-by: Peff" --trailer "Acked-by: Johan" >actual &&
        test_cmp expected actual
 '
 
+test_expect_success 'with only a title in the message' '
+       cat >expected <<-\EOF &&
+               area: change
+
+               Reviewed-by: Peff
+               Acked-by: Johan
+       EOF
+       echo "area: change" |
+       git interpret-trailers --trailer "Reviewed-by: Peff" \
+               --trailer "Acked-by: Johan" >actual &&
+       test_cmp expected actual
+'
+
+test_expect_success 'with multiline title in the message' '
+       cat >expected <<-\EOF &&
+               place of
+               code: change
+
+               Reviewed-by: Peff
+               Acked-by: Johan
+       EOF
+       printf "%s\n" "place of" "code: change" |
+       git interpret-trailers --trailer "Reviewed-by: Peff" \
+               --trailer "Acked-by: Johan" >actual &&
+       test_cmp expected actual
+'
+
 test_expect_success 'with config setup' '
        git config trailer.ack.key "Acked-by: " &&
        cat >expected <<-\EOF &&