MCPcopy Index your code
hub / github.com/git/git / format_subject

Function format_subject

pretty.c:976–998  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

974}
975
976const char *format_subject(struct strbuf *sb, const char *msg,
977 const char *line_separator)
978{
979 int first = 1;
980
981 for (;;) {
982 const char *line = msg;
983 int linelen = get_one_line(line);
984
985 msg += linelen;
986 if (!linelen || is_blank_line(line, &linelen))
987 break;
988
989 if (!sb)
990 continue;
991 strbuf_grow(sb, linelen + 2);
992 if (!first)
993 strbuf_addstr(sb, line_separator);
994 strbuf_add(sb, line, linelen);
995 first = 0;
996 }
997 return msg;
998}
999
1000static void parse_commit_message(struct format_commit_context *c)
1001{

Callers 7

parse_commit_messageFunction · 0.85
format_commit_oneFunction · 0.85
pp_email_subjectFunction · 0.85
pretty_print_commitFunction · 0.85
prepare_cover_textFunction · 0.85
insert_one_recordFunction · 0.85

Calls 5

get_one_lineFunction · 0.85
strbuf_growFunction · 0.85
strbuf_addstrFunction · 0.85
strbuf_addFunction · 0.85
is_blank_lineFunction · 0.70

Tested by

no test coverage detected