summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-03-16 16:47:26 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-03-16 16:47:26 -0700
commitafb497d472c22ba12c5b3313b6fdad132025468e (patch)
tree5451adb8378dd949795e96fe898463a06aadcf90 /t
parentMerge branch 'lt/rename-no-extra-copy-detection' into maint (diff)
parentcommit: error out for missing commit message template (diff)
downloadtgif-afb497d472c22ba12c5b3313b6fdad132025468e.tar.xz
Merge branch 'jn/maint-commit-missing-template' into maint
* jn/maint-commit-missing-template: commit: error out for missing commit message template
Diffstat (limited to 't')
-rwxr-xr-xt/t7500-commit.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh
index d551b77ce6..5976f598fc 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.