diff options
author | René Scharfe <l.s.r@web.de> | 2017-03-01 12:37:07 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-01 15:09:17 -0800 |
commit | 6d167fd7ccb84f07a0bd57d8e188a651e913b158 (patch) | |
tree | 73b2ac5bf9dd492b1b8112ababde2c2e16caac84 /pretty.c | |
parent | 8ffc8dc6bab4cf3d2364dd54b2de6c3afdb48610 (diff) | |
download | git-6d167fd7ccb84f07a0bd57d8e188a651e913b158.tar.gz |
pretty: use fmt_output_email_subject()rs/log-email-subject
Add the email-style subject prefix (e.g. "Subject: [PATCH] ") directly
when it's needed instead of letting log_write_email_headers() prepare
it in a static buffer in advance. This simplifies storage ownership and
code flow.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pretty.c')
-rw-r--r-- | pretty.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1590,8 +1590,9 @@ void pp_title_line(struct pretty_print_context *pp, pp->preserve_subject ? "\n" : " "); strbuf_grow(sb, title.len + 1024); - if (pp->subject) { - strbuf_addstr(sb, pp->subject); + if (pp->print_email_subject) { + if (pp->rev) + fmt_output_email_subject(sb, pp->rev); if (needs_rfc2047_encoding(title.buf, title.len, RFC2047_SUBJECT)) add_rfc2047(sb, title.buf, title.len, encoding, RFC2047_SUBJECT); @@ -1801,7 +1802,7 @@ void pretty_print_commit(struct pretty_print_context *pp, } pp_header(pp, encoding, commit, &msg, sb); - if (pp->fmt != CMIT_FMT_ONELINE && !pp->subject) { + if (pp->fmt != CMIT_FMT_ONELINE && !pp->print_email_subject) { strbuf_addch(sb, '\n'); } |