diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-03-04 15:02:27 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-03-04 15:02:27 -0800 |
commit | 5cb3c9b7dff15f762d63df0b6f2d6b4bf82565e9 (patch) | |
tree | e680e8e07351059a97739564f23ef38ec97c7716 /t/t7500-commit.sh | |
parent | 1538f21bfb33dcaa65fe84b9823a8963bf1e6443 (diff) | |
parent | 2140b14064ffe6b12ba6818b2894d1461a943fb9 (diff) | |
download | git-5cb3c9b7dff15f762d63df0b6f2d6b4bf82565e9.tar.gz git-5cb3c9b7dff15f762d63df0b6f2d6b4bf82565e9.tar.xz |
Merge branch 'jn/maint-commit-missing-template'
* jn/maint-commit-missing-template:
commit: error out for missing commit message template
Diffstat (limited to 't/t7500-commit.sh')
-rwxr-xr-x | t/t7500-commit.sh | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh index d551b77ce..5976f598f 100755 --- a/t/t7500-commit.sh +++ b/t/t7500-commit.sh @@ -28,13 +28,21 @@ test_expect_success 'a basic commit in an empty tree should succeed' ' test_expect_success 'nonexistent template file should return error' ' echo changes >> foo && git add foo && - test_must_fail git commit --template "$PWD"/notexist + ( + GIT_EDITOR="echo hello >\"\$1\"" && + export GIT_EDITOR && + test_must_fail git commit --template "$PWD"/notexist + ) ' test_expect_success 'nonexistent template file in config should return error' ' git config commit.template "$PWD"/notexist && - test_must_fail git commit && - git config --unset commit.template + test_when_finished "git config --unset commit.template" && + ( + GIT_EDITOR="echo hello >\"\$1\"" && + export GIT_EDITOR && + test_must_fail git commit + ) ' # From now on we'll use a template file that exists. |