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>
This commit is contained in:
@@ -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 &&
|
||||
|
||||
Reference in New Issue
Block a user