Support a --quiet option in the test-suite.
[gitweb.git] / log-tree.c
index 3e5e6acfafb5345b8ed4f67599270e841b194ade..62edd344558049f05c33888de9d2fc2a854b51e9 100644 (file)
@@ -280,7 +280,8 @@ void show_log(struct rev_info *opt, const char *sep)
        if (opt->show_log_size)
                printf("log size %i\n", (int)msgbuf.len);
 
-       printf("%s%s%s", msgbuf.buf, extra, sep);
+       if (msgbuf.len)
+               printf("%s%s%s", msgbuf.buf, extra, sep);
        strbuf_release(&msgbuf);
 }
 
@@ -303,7 +304,8 @@ int log_tree_diff_flush(struct rev_info *opt)
                 * output for readability.
                 */
                show_log(opt, opt->diffopt.msg_sep);
-               if (opt->verbose_header &&
+               if ((opt->diffopt.output_format & ~DIFF_FORMAT_NO_OUTPUT) &&
+                   opt->verbose_header &&
                    opt->commit_format != CMIT_FMT_ONELINE) {
                        int pch = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_PATCH;
                        if ((pch & opt->diffopt.output_format) == pch)