Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-04-23 01:45:07 +0300
committerJunio C Hamano <gitster@pobox.com>2016-04-23 01:45:07 +0300
commit0709261a83f0a386c6415d889a6e2617e62db710 (patch)
tree0ef9793aa849103d4424c5cb59f334ac6e84f5d5 /builtin/commit.c
parent56b5a915e9ec5bc27c05dc7babfc601f46803d1c (diff)
parent27014cbc04e369624f6c1754b72ef4eddb911166 (diff)
Merge branch 'ad/commit-have-m-option'
"git commit" misbehaved in a few minor ways when an empty message is given via -m '', all of which has been corrected. * ad/commit-have-m-option: commit: do not ignore an empty message given by -m '' commit: --amend -m '' silently fails to wipe message
Diffstat (limited to 'builtin/commit.c')
-rw-r--r--builtin/commit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 98e15276df..391126e58d 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -695,7 +695,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
}
}
- if (message.len) {
+ if (have_option_m) {
strbuf_addbuf(&sb, &message);
hook_arg1 = "message";
} else if (logfile && !strcmp(logfile, "-")) {
@@ -1172,9 +1172,9 @@ static int parse_and_validate_options(int argc, const char *argv[],
f++;
if (f > 1)
die(_("Only one of -c/-C/-F/--fixup can be used."));
- if (message.len && f > 0)
+ if (have_option_m && f > 0)
die((_("Option -m cannot be combined with -c/-C/-F/--fixup.")));
- if (f || message.len)
+ if (f || have_option_m)
template_file = NULL;
if (edit_message)
use_message = edit_message;