diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-05-13 11:03:08 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-05-13 11:03:08 -0700 |
commit | e4ae6efb78ca7d2ff16575f841b1781b96a7582c (patch) | |
tree | 13a3465c8d49a740846ac291d60486465d20a3a3 /t | |
parent | d6ad4ff1202bd79f6470e8699bbd16d6ceb6ae98 (diff) | |
parent | 8b1ae678a33e2d1ccf3080977b692a59acad9b50 (diff) | |
download | git-e4ae6efb78ca7d2ff16575f841b1781b96a7582c.tar.gz |
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 't')
-rwxr-xr-x | t/t7500-commit.sh | 14 | ||||
-rwxr-xr-x | t/t7500/add-whitespaced-content | 8 |
2 files changed, 22 insertions, 0 deletions
diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh index 47096f9014..1c908f4d39 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 && diff --git a/t/t7500/add-whitespaced-content b/t/t7500/add-whitespaced-content new file mode 100755 index 0000000000..ccf07c61a4 --- /dev/null +++ b/t/t7500/add-whitespaced-content @@ -0,0 +1,8 @@ +#!/bin/sh +sed -e 's/|$//' >>"$1" <<\EOF + + | +commit message | + +EOF +exit 0 |