MCPcopy Create free account
hub / github.com/git/git / fmt_output_subject

Function fmt_output_subject

log-tree.c:440–462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

438}
439
440void 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
464void fmt_output_commit(struct strbuf *filename,
465 struct commit *commit,

Callers 2

fmt_output_commitFunction · 0.85
open_next_fileFunction · 0.85

Calls 5

strbuf_addfFunction · 0.85
format_sanitized_subjectFunction · 0.85
strbuf_addstrFunction · 0.85
strbuf_releaseFunction · 0.85
strbuf_setlenFunction · 0.85

Tested by

no test coverage detected