strbuf_init(&buf, 0);
pretty_print_commit(revs.commit_format, commit,
&buf, revs.abbrev, NULL, NULL, revs.date_mode);
- printf("%s%c", buf.buf, hdr_termination);
+ if (buf.len)
+ printf("%s%c", buf.buf, hdr_termination);
strbuf_release(&buf);
}
maybe_flush_or_die(stdout, "stdout");
/* Do the real work of finding bisection commit. */
best = do_find_bisection(list, nr, weights);
- if (best)
+ if (best) {
best->next = NULL;
-
- *reaches = weight(best);
+ *reaches = weight(best);
+ }
free(weights);
return best;