From: Junio C Hamano Date: Wed, 25 Jun 2014 18:46:54 +0000 (-0700) Subject: Merge branch 'jk/commit-C-pick-empty' into maint X-Git-Tag: v2.0.1~18 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/b659f8108562f931fcd0ecf900dd4da9ff831ce8 Merge branch 'jk/commit-C-pick-empty' into maint "git commit --allow-empty-message -C $commit" did not work when the commit did not have any log message. * jk/commit-C-pick-empty: commit: do not complain of empty messages from -C --- b659f8108562f931fcd0ecf900dd4da9ff831ce8 diff --cc builtin/commit.c index 9cfef6c6cc,aa04507174..65c069d2cb --- a/builtin/commit.c +++ b/builtin/commit.c @@@ -648,11 -649,9 +648,10 @@@ static int prepare_to_commit(const cha logfile); hook_arg1 = "message"; } else if (use_message) { + char *buffer; buffer = strstr(use_message_buffer, "\n\n"); - if (!use_editor && (!buffer || buffer[2] == '\0')) - die(_("commit has empty message")); - strbuf_add(&sb, buffer + 2, strlen(buffer + 2)); + if (buffer) + strbuf_add(&sb, buffer + 2, strlen(buffer + 2)); hook_arg1 = "commit"; hook_arg2 = use_message; } else if (fixup_message) {