diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-04-26 10:35:15 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-04-26 10:35:15 -0700 |
commit | b4bd6bb356795ef817d44d65c16bba7f192ab29e (patch) | |
tree | fa810822ac0ebc8d83178a888f7340acbb6e04dc /t/t7501-commit.sh | |
parent | 4579a0547cc558bd0e341adb77897e1f2f331f78 (diff) | |
parent | 1f08c2c8258cb09d4e78b8c3ff7e45a570f957ea (diff) |
Merge branch 'jc/commit-unedited-template' into maint
When "git commit --template F" errors out because the user did not
touch the message, it claimed that it aborts due to "empty message",
which was utterly wrong.
By Junio C Hamano (4) and Adam Monsen (1)
* jc/commit-unedited-template:
Documentation/git-commit: rephrase the "initial-ness" of templates
git-commit.txt: clarify -t requires editing message
commit: rephrase the error when user did not touch templated log message
commit: do not trigger bogus "has templated message edited" check
t7501: test the right kind of breakage
Diffstat (limited to 't/t7501-commit.sh')
-rwxr-xr-x | t/t7501-commit.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh index 8bb38337a9..b20ca0eace 100755 --- a/t/t7501-commit.sh +++ b/t/t7501-commit.sh @@ -30,10 +30,12 @@ test_expect_success 'setup: initial commit' ' ' test_expect_success '-m and -F do not mix' ' + git checkout HEAD file && echo >>file && git add file && test_must_fail git commit -m foo -m bar -F file ' test_expect_success '-m and -C do not mix' ' + git checkout HEAD file && echo >>file && git add file && test_must_fail git commit -C HEAD -m illegal ' @@ -79,7 +81,19 @@ test_expect_success 'empty commit message' ' test_must_fail git commit -F msg -a ' +test_expect_success 'template "emptyness" check does not kick in with -F' ' + git checkout HEAD file && echo >>file && git add file && + 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 && git commit -F msg -a ' |