format-patch: preserve subject newlines with -k
[gitweb.git] / pretty.c
index 1bb7e075eaf7e7a59502931fd4f57a9c391a7e4e..193bafd8352e72b0c3a7c65748500a558392e917 100644 (file)
--- a/pretty.c
+++ b/pretty.c
@@ -1131,7 +1131,8 @@ void pp_title_line(const struct pretty_print_context *pp,
        struct strbuf title;
 
        strbuf_init(&title, 80);
-       *msg_p = format_subject(&title, *msg_p, " ");
+       *msg_p = format_subject(&title, *msg_p,
+                               pp->preserve_subject ? "\n" : " ");
 
        strbuf_grow(sb, title.len + 1024);
        if (pp->subject) {