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

Function check_inbody_header

mailinfo.c:756–791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

754}
755
756static int check_inbody_header(struct mailinfo *mi, const struct strbuf *line)
757{
758 if (mi->inbody_header_accum.len &&
759 (line->buf[0] == ' ' || line->buf[0] == '\t')) {
760 if (mi->use_scissors && is_scissors_line(line->buf)) {
761 /*
762 * This is a scissors line; do not consider this line
763 * as a header continuation line.
764 */
765 flush_inbody_header_accum(mi);
766 return 0;
767 }
768 strbuf_strip_suffix(&mi->inbody_header_accum, "\n");
769 strbuf_addbuf(&mi->inbody_header_accum, line);
770 return 1;
771 }
772
773 flush_inbody_header_accum(mi);
774
775 if (starts_with(line->buf, ">From") && isspace(line->buf[5]))
776 return is_format_patch_separator(line->buf + 1, line->len - 1);
777 if (starts_with(line->buf, "[PATCH]") && isspace(line->buf[7])) {
778 int i;
779 for (i = 0; i < ARRAY_SIZE(header); i++)
780 if (!strcmp("Subject", header[i])) {
781 handle_header(&mi->s_hdr_data[i], line);
782 return 1;
783 }
784 return 0;
785 }
786 if (is_inbody_header(mi, line)) {
787 strbuf_addbuf(&mi->inbody_header_accum, line);
788 return 1;
789 }
790 return 0;
791}
792
793static int handle_commit_msg(struct mailinfo *mi, struct strbuf *line)
794{

Callers 1

handle_commit_msgFunction · 0.70

Calls 8

strbuf_strip_suffixFunction · 0.85
strbuf_addbufFunction · 0.85
starts_withFunction · 0.85
is_scissors_lineFunction · 0.70
handle_headerFunction · 0.70
is_inbody_headerFunction · 0.70

Tested by

no test coverage detected