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>2011-05-13 22:03:08 +0400
committerJunio C Hamano <gitster@pobox.com>2011-05-13 22:03:08 +0400
commite4ae6efb78ca7d2ff16575f841b1781b96a7582c (patch)
tree13a3465c8d49a740846ac291d60486465d20a3a3 /builtin
parentd6ad4ff1202bd79f6470e8699bbd16d6ceb6ae98 (diff)
parent8b1ae678a33e2d1ccf3080977b692a59acad9b50 (diff)
Merge branch 'bf/commit-template-no-cleanup'
* bf/commit-template-no-cleanup: Do not strip empty lines / trailing spaces from a commit message template
Diffstat (limited to 'builtin')
-rw-r--r--builtin/commit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 67757e999f..411d5e4153 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) {