diff options
author | Phillip Wood <phillip.wood@dunelm.org.uk> | 2017-11-10 11:09:42 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-11-10 18:33:26 (GMT) |
commit | d0aaa46fd3e53801346a4cadebf398f05d79780b (patch) | |
tree | 1ec5d7c8d6c06a0aeac12a057754bab3448f43f5 /sequencer.h | |
parent | 60b6158886b1b502c75f12facff9df45e731112b (diff) | |
download | git-d0aaa46fd3e53801346a4cadebf398f05d79780b.zip git-d0aaa46fd3e53801346a4cadebf398f05d79780b.tar.gz git-d0aaa46fd3e53801346a4cadebf398f05d79780b.tar.bz2 |
commit: move empty message checks to libgit
Move the functions that check for empty messages from bulitin/commit.c
to sequencer.c so they can be shared with other commands. The
functions are refactored to take an explicit cleanup mode and template
filename passed by the caller.
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.h')
-rw-r--r-- | sequencer.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sequencer.h b/sequencer.h index 6f3d3df..82e5771 100644 --- a/sequencer.h +++ b/sequencer.h @@ -58,4 +58,15 @@ extern const char sign_off_header[]; void append_signoff(struct strbuf *msgbuf, int ignore_footer, unsigned flag); void append_conflicts_hint(struct strbuf *msgbuf); +enum commit_msg_cleanup_mode { + COMMIT_MSG_CLEANUP_SPACE, + COMMIT_MSG_CLEANUP_NONE, + COMMIT_MSG_CLEANUP_SCISSORS, + COMMIT_MSG_CLEANUP_ALL +}; + +int message_is_empty(const struct strbuf *sb, + enum commit_msg_cleanup_mode cleanup_mode); +int template_untouched(const struct strbuf *sb, const char *template_file, + enum commit_msg_cleanup_mode cleanup_mode); #endif |