diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-08-11 13:27:01 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-11 13:27:01 -0700 |
commit | 2b473ce78c5af196caf219fe021c0453108e0244 (patch) | |
tree | f348d23c1e79e8f37525f256dd0a9dc812a0f65c /builtin/commit.c | |
parent | 55c965f3a27b3a36f84c56b6eba8ac5c95ff558a (diff) | |
parent | bc17f35f8c65295fbfcb281dda8560136fb26fb4 (diff) | |
download | git-2b473ce78c5af196caf219fe021c0453108e0244.tar.gz |
Merge branch 'ks/commit-abort-on-empty-message-fix'
"git commit" when seeing an totally empty message said "you did not
edit the message", which is clearly wrong. The message has been
corrected.
* ks/commit-abort-on-empty-message-fix:
commit: check for empty message before the check for untouched template
Diffstat (limited to 'builtin/commit.c')
-rw-r--r-- | builtin/commit.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index 4bbac014ab..e7a2cb6285 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1739,17 +1739,17 @@ int cmd_commit(int argc, const char **argv, const char *prefix) if (verbose || /* Truncate the message just before the diff, if any. */ cleanup_mode == CLEANUP_SCISSORS) strbuf_setlen(&sb, wt_status_locate_end(sb.buf, sb.len)); - if (cleanup_mode != CLEANUP_NONE) strbuf_stripspace(&sb, cleanup_mode == CLEANUP_ALL); - if (template_untouched(&sb) && !allow_empty_message) { + + if (message_is_empty(&sb) && !allow_empty_message) { rollback_index_files(); - fprintf(stderr, _("Aborting commit; you did not edit the message.\n")); + fprintf(stderr, _("Aborting commit due to empty commit message.\n")); exit(1); } - if (message_is_empty(&sb) && !allow_empty_message) { + if (template_untouched(&sb) && !allow_empty_message) { rollback_index_files(); - fprintf(stderr, _("Aborting commit due to empty commit message.\n")); + fprintf(stderr, _("Aborting commit; you did not edit the message.\n")); exit(1); } |