summaryrefslogtreecommitdiff
path: root/t/t7501-commit.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-03-30 12:14:33 -0700
committerJunio C Hamano <gitster@pobox.com>2012-03-30 12:20:00 -0700
commitb2eda9bdfbacdd3bb52da2ebcb468415cf153940 (patch)
tree4c2c39f109910aa25121fa11d4e4e68ead4da84d /t/t7501-commit.sh
parent010c7dbcbe2e55c1dcc85f23fbe55be6d7e931f0 (diff)
downloadgit-b2eda9bdfbacdd3bb52da2ebcb468415cf153940.tar.gz
commit: rephrase the error when user did not touch templated log message
When the user exited editor without editing the commit log template given by "git commit -t <template>", the commit was aborted (correct) with an error message that said "due to empty commit message" (incorrect). This was because the original template support was done by piggybacking on the check to detect an empty log message. Split the codepaths into two independent checks to clarify the error. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7501-commit.sh')
-rwxr-xr-xt/t7501-commit.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index e59cc4e861..b20ca0eace 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -86,6 +86,12 @@ test_expect_success 'template "emptyness" check does not kick in with -F' '
git commit -t file -F file
'
+test_expect_success 'template "emptyness" check' '
+ git checkout HEAD file && echo >>file && git add file &&
+ test_must_fail git commit -t file 2>err &&
+ test_i18ngrep "did not edit" err
+'
+
test_expect_success 'setup: commit message from file' '
git checkout HEAD file && echo >>file && git add file &&
echo this is the commit message, coming from a file >msg &&