summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-03-30 18:30:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-03-30 18:30:59 (GMT)
commit010c7dbcbe2e55c1dcc85f23fbe55be6d7e931f0 (patch)
tree75db8300a1c5b7e5463f5232c9a8cc4fb37fec4e /builtin/commit.c
parentc65dc351f0ae184f69cbc0b6555ff19aacb70e01 (diff)
downloadgit-010c7dbcbe2e55c1dcc85f23fbe55be6d7e931f0.zip
git-010c7dbcbe2e55c1dcc85f23fbe55be6d7e931f0.tar.gz
git-010c7dbcbe2e55c1dcc85f23fbe55be6d7e931f0.tar.bz2
commit: do not trigger bogus "has templated message edited" check
When "-t template" and "-F msg" options are both given (or worse yet, there is "commit.template" configuration but a message is given in some other way), the documentation says that template is ignored. However, the "has the user edited the message?" check still used the contents of the template file as the basis of the emptyness check. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
-rw-r--r--builtin/commit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index eba1377..7141766 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1049,6 +1049,8 @@ static int parse_and_validate_options(int argc, const char *argv[],
die(_("Only one of -c/-C/-F/--fixup can be used."));
if (message.len && f > 0)
die((_("Option -m cannot be combined with -c/-C/-F/--fixup.")));
+ if (f || message.len)
+ template_file = NULL;
if (edit_message)
use_message = edit_message;
if (amend && !use_message && !fixup_message)