1
0
mirror of https://github.com/git/git.git synced 2024-11-18 21:23:51 +01:00

log: print log entry terminator even if the message is empty

This eliminates a special case in the show_log() function, to help
simplify the terminator semantics.  Now show_log() always prints a
newline after the log entry when use_terminator is set, even if the log
message is empty.

This change should only affect the --pretty=tformat output, since that
was the only way to trigger this special case.

Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Adam Simpkins 2008-04-29 01:33:00 -07:00 committed by Junio C Hamano
parent 028656552b
commit 9b58bfe8f4

@ -307,11 +307,10 @@ void show_log(struct rev_info *opt)
if (opt->show_log_size) if (opt->show_log_size)
printf("log size %i\n", (int)msgbuf.len); printf("log size %i\n", (int)msgbuf.len);
if (msgbuf.len) { if (msgbuf.len)
fwrite(msgbuf.buf, sizeof(char), msgbuf.len, stdout); fwrite(msgbuf.buf, sizeof(char), msgbuf.len, stdout);
if (opt->use_terminator) if (opt->use_terminator)
putchar('\n'); putchar('\n');
}
strbuf_release(&msgbuf); strbuf_release(&msgbuf);
} }