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

Function rest_is_empty

sequencer.c:1186–1210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1184}
1185
1186static int rest_is_empty(const struct strbuf *sb, int start)
1187{
1188 int i, eol;
1189 const char *nl;
1190
1191 /* Check if the rest is just whitespace and Signed-off-by's. */
1192 for (i = start; i < sb->len; i++) {
1193 nl = memchr(sb->buf + i, '\n', sb->len - i);
1194 if (nl)
1195 eol = nl - sb->buf;
1196 else
1197 eol = sb->len;
1198
1199 if (strlen(sign_off_header) <= eol - i &&
1200 starts_with(sb->buf + i, sign_off_header)) {
1201 i = eol;
1202 continue;
1203 }
1204 while (i < eol)
1205 if (!isspace(sb->buf[i++]))
1206 return 0;
1207 }
1208
1209 return 1;
1210}
1211
1212void cleanup_message(struct strbuf *msgbuf,
1213 enum commit_msg_cleanup_mode cleanup_mode, int verbose)

Callers 2

message_is_emptyFunction · 0.85
template_untouchedFunction · 0.85

Calls 1

starts_withFunction · 0.85

Tested by

no test coverage detected