| 1184 | } |
| 1185 | |
| 1186 | static 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 | |
| 1212 | void cleanup_message(struct strbuf *msgbuf, |
| 1213 | enum commit_msg_cleanup_mode cleanup_mode, int verbose) |
no test coverage detected