]> git.ipfire.org Git - thirdparty/git.git/commitdiff
log: print log entry terminator even if the message is empty
authorAdam Simpkins <adam@adamsimpkins.net>
Tue, 29 Apr 2008 08:33:00 +0000 (01:33 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 3 May 2008 18:50:41 +0000 (11:50 -0700)
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>
log-tree.c

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