summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2014-06-25 11:46:54 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-06-25 11:46:54 -0700
commitb659f8108562f931fcd0ecf900dd4da9ff831ce8 (patch)
tree5dfe7d3327f282b0fd040f4835f86272e4b9ee23 /builtin
parentMerge branch 'bc/blame-crlf-test' into maint (diff)
parentcommit: do not complain of empty messages from -C (diff)
downloadtgif-b659f8108562f931fcd0ecf900dd4da9ff831ce8.tar.xz
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
Diffstat (limited to 'builtin')
-rw-r--r--builtin/commit.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 9cfef6c6cc..65c069d2cb 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -650,9 +650,8 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
} 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) {