| 438 | } |
| 439 | |
| 440 | void fmt_output_subject(struct strbuf *filename, |
| 441 | const char *subject, |
| 442 | struct rev_info *info) |
| 443 | { |
| 444 | const char *suffix = info->patch_suffix; |
| 445 | int nr = info->nr; |
| 446 | int start_len = filename->len; |
| 447 | int max_len = start_len + info->patch_name_max - (strlen(suffix) + 1); |
| 448 | |
| 449 | if (info->reroll_count) { |
| 450 | struct strbuf temp = STRBUF_INIT; |
| 451 | |
| 452 | strbuf_addf(&temp, "v%s", info->reroll_count); |
| 453 | format_sanitized_subject(filename, temp.buf, temp.len); |
| 454 | strbuf_addstr(filename, "-"); |
| 455 | strbuf_release(&temp); |
| 456 | } |
| 457 | strbuf_addf(filename, "%04d-%s", nr, subject); |
| 458 | |
| 459 | if (max_len < filename->len) |
| 460 | strbuf_setlen(filename, max_len); |
| 461 | strbuf_addstr(filename, suffix); |
| 462 | } |
| 463 | |
| 464 | void fmt_output_commit(struct strbuf *filename, |
| 465 | struct commit *commit, |
no test coverage detected