diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh
index d551b77ce6d94acce80069f2197f0169ee59e6d5..5976f598fc7bf48120865eca3ceef74a151e717a 100755 (executable)
--- a/t/t7500-commit.sh
+++ b/t/t7500-commit.sh
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.