diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/commit.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index c733ec98b7..e13303787a 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -694,7 +694,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, "-")) { @@ -1171,9 +1171,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; |