X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin%2Fcommit.c;h=411d5e41531adabe679df2d1381dbf923c5e925b;hb=02071b27f1587c65ddc4779017a3ddceb777de9c;hp=67757e999fba514b62767d3351031e9eb6ef8c10;hpb=f7d59e256884f63adeed9a1f3376a386a28681ff;p=git.git diff --git a/builtin/commit.c b/builtin/commit.c index 67757e999..411d5e415 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -615,6 +615,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix, const char *hook_arg1 = NULL; const char *hook_arg2 = NULL; int ident_shown = 0; + int clean_message_contents = (cleanup_mode != CLEANUP_NONE); if (!no_verify && run_hook(index_file, "pre-commit", NULL)) return 0; @@ -681,6 +682,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix, if (strbuf_read_file(&sb, template_file, 0) < 0) die_errno(_("could not read '%s'"), template_file); hook_arg1 = "template"; + clean_message_contents = 0; } /* @@ -708,7 +710,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix, if (s->fp == NULL) die_errno(_("could not open '%s'"), git_path(commit_editmsg)); - if (cleanup_mode != CLEANUP_NONE) + if (clean_message_contents) stripspace(&sb, 0); if (signoff) {