From 8b1ae678a33e2d1ccf3080977b692a59acad9b50 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Sun, 8 May 2011 12:31:02 +0200 Subject: Do not strip empty lines / trailing spaces from a commit message template Templates should be just that: A form that the user fills out, and forms have blanks. If people are attached to not having extra whitespace in the editor, they can simply clean up their templates. Added test with editor adding even more whitespace. Signed-off-by: Boris Faure Based-on-patch-by:Sebastian Schuberth Signed-off-by: Junio C Hamano --- t/t7500-commit.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 't/t7500-commit.sh') diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh index bcdf0847d0..9ef00906cc 100755 --- a/t/t7500-commit.sh +++ b/t/t7500-commit.sh @@ -123,6 +123,20 @@ test_expect_success 'commit message from file should override template' ' commit_msg_is "standard input msg" ' +cat >"$TEMPLATE" <<\EOF + + +### template + +EOF +test_expect_success 'commit message from template with whitespace issue' ' + echo "content galore" >>foo && + git add foo && + GIT_EDITOR="$TEST_DIRECTORY"/t7500/add-whitespaced-content git commit \ + --template "$TEMPLATE" && + commit_msg_is "commit message" +' + test_expect_success 'using alternate GIT_INDEX_FILE (1)' ' cp .git/index saved-index && -- cgit v1.2.1