summaryrefslogtreecommitdiff
path: root/t/t7500-commit.sh
diff options
context:
space:
mode:
authorYann Droneaud <ydroneaud@opteya.com>2013-03-24 21:06:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-03-25 15:50:53 (GMT)
commit22179b307894a6e14f33459b43cd485a03ac4add (patch)
treea4f4b80ec007b4b6c1fa3899a1a52eb42d8014e7 /t/t7500-commit.sh
parent8677b777a57e1d843d4aef2d5a12f3cd9ccb7609 (diff)
downloadgit-22179b307894a6e14f33459b43cd485a03ac4add.zip
git-22179b307894a6e14f33459b43cd485a03ac4add.tar.gz
git-22179b307894a6e14f33459b43cd485a03ac4add.tar.bz2
t7500: use test_config to set/unset git config variables
Instead of using construct such as: test_when_finished "git config --unset <key>" git config <key> <value> uses test_config <key> <value> The latter takes care of removing <key> at the end of the test. Signed-off-by: Yann Droneaud <ydroneaud@opteya.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7500-commit.sh')
-rwxr-xr-xt/t7500-commit.sh6
1 files changed, 2 insertions, 4 deletions
diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh
index 1c908f4..436b7b6 100755
--- a/t/t7500-commit.sh
+++ b/t/t7500-commit.sh
@@ -36,8 +36,7 @@ test_expect_success 'nonexistent template file should return error' '
'
test_expect_success 'nonexistent template file in config should return error' '
- git config commit.template "$PWD"/notexist &&
- test_when_finished "git config --unset commit.template" &&
+ test_config commit.template "$PWD"/notexist &&
(
GIT_EDITOR="echo hello >\"\$1\"" &&
export GIT_EDITOR &&
@@ -93,14 +92,13 @@ test_expect_success '-t option should be short for --template' '
test_expect_success 'config-specified template should commit' '
echo "new template" > "$TEMPLATE" &&
- git config commit.template "$TEMPLATE" &&
+ test_config commit.template "$TEMPLATE" &&
echo "more content" >> foo &&
git add foo &&
(
test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
git commit
) &&
- git config --unset commit.template &&
commit_msg_is "new templatecommit message"
'