Skip to content

Commit 9b58bfe

Browse files
simpkinsgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0286565 commit 9b58bfe

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

log-tree.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,10 @@ void show_log(struct rev_info *opt)
307307
if (opt->show_log_size)
308308
printf("log size %i\n", (int)msgbuf.len);
309309

310-
if (msgbuf.len) {
310+
if (msgbuf.len)
311311
fwrite(msgbuf.buf, sizeof(char), msgbuf.len, stdout);
312-
if (opt->use_terminator)
313-
putchar('\n');
314-
}
312+
if (opt->use_terminator)
313+
putchar('\n');
315314
strbuf_release(&msgbuf);
316315
}
317316

0 commit comments

Comments
 (0)