* See if the user edited the message in the editor or left what * was in the template intact */
| 1237 | * was in the template intact |
| 1238 | */ |
| 1239 | int template_untouched(const struct strbuf *sb, const char *template_file, |
| 1240 | enum commit_msg_cleanup_mode cleanup_mode) |
| 1241 | { |
| 1242 | struct strbuf tmpl = STRBUF_INIT; |
| 1243 | const char *start; |
| 1244 | |
| 1245 | if (cleanup_mode == COMMIT_MSG_CLEANUP_NONE && sb->len) |
| 1246 | return 0; |
| 1247 | |
| 1248 | if (!template_file || strbuf_read_file(&tmpl, template_file, 0) <= 0) |
| 1249 | return 0; |
| 1250 | |
| 1251 | strbuf_stripspace(&tmpl, |
| 1252 | cleanup_mode == COMMIT_MSG_CLEANUP_ALL ? comment_line_str : NULL); |
| 1253 | if (!skip_prefix(sb->buf, tmpl.buf, &start)) |
| 1254 | start = sb->buf; |
| 1255 | strbuf_release(&tmpl); |
| 1256 | return rest_is_empty(sb, start - sb->buf); |
| 1257 | } |
| 1258 | |
| 1259 | int update_head_with_reflog(const struct commit *old_head, |
| 1260 | const struct object_id *new_head, |
no test coverage detected