| 271 | } |
| 272 | |
| 273 | static void log_commit(FILE *fp, |
| 274 | const char *fmt, const char *state, |
| 275 | struct commit *commit) |
| 276 | { |
| 277 | struct pretty_print_context pp = {0}; |
| 278 | struct strbuf commit_msg = STRBUF_INIT; |
| 279 | char *label = xstrfmt(fmt, state); |
| 280 | |
| 281 | repo_format_commit_message(the_repository, commit, "%s", &commit_msg, |
| 282 | &pp); |
| 283 | |
| 284 | fprintf(fp, "# %s: [%s] %s\n", label, oid_to_hex(&commit->object.oid), |
| 285 | commit_msg.buf); |
| 286 | |
| 287 | strbuf_release(&commit_msg); |
| 288 | free(label); |
| 289 | } |
| 290 | |
| 291 | static int bisect_write(const char *state, const char *rev, |
| 292 | const struct bisect_terms *terms, int nolog) |
no test coverage detected