aboutsummaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-06-25 11:46:54 -0700
committerJunio C Hamano <gitster@pobox.com>2014-06-25 11:46:54 -0700
commitb659f8108562f931fcd0ecf900dd4da9ff831ce8 (patch)
tree5dfe7d3327f282b0fd040f4835f86272e4b9ee23 /builtin/commit.c
parent4d27d8cbc4ac74fee7b64ca9182ad920b958655f (diff)
parent076cbd6341182d296671cb101c75145eb3bfda0a (diff)
downloadgit-b659f8108562f931fcd0ecf900dd4da9ff831ce8.tar.gz
git-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/commit.c')
-rw-r--r--builtin/commit.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 9cfef6c6c..65c069d2c 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) {