diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-04-16 12:43:07 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-04-16 12:43:07 -0700 |
commit | 091df17f27ed735160bbd82360efb8154b35ffeb (patch) | |
tree | 497296ce56e74c321d7076e5c9dedfae38aa1ac5 /t | |
parent | fa0ba729dc5e0af0b0165e4e12904bfa3f39f9db (diff) | |
parent | 1f08c2c8258cb09d4e78b8c3ff7e45a570f957ea (diff) | |
download | git-091df17f27ed735160bbd82360efb8154b35ffeb.tar.gz |
Merge branch 'jc/commit-unedited-template'
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')
-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 ' |