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>

Yann Droneaud committed Mar 24, 2013 at 22:06 UTC 22179b307894a6e14f33459b43cd485a03ac4add
1 file changed +2 -4
t/t7500-commit.sh
+2 -4
@@ -36,8 +36,7 @@ test_expect_success 'nonexistent template file should return error' '
36 '
37
38 test_expect_success 'nonexistent template file in config should return error' '
39 - git config commit.template "$PWD"/notexist &&
40 - test_when_finished "git config --unset commit.template" &&
39 + test_config commit.template "$PWD"/notexist &&
40 (
41 GIT_EDITOR="echo hello >\"\$1\"" &&
42 export GIT_EDITOR &&
@@ -93,14 +92,13 @@ test_expect_success '-t option should be short for --template' '
92
93 test_expect_success 'config-specified template should commit' '
94 echo "new template" > "$TEMPLATE" &&
96 - git config commit.template "$TEMPLATE" &&
95 + test_config commit.template "$TEMPLATE" &&
96 echo "more content" >> foo &&
97 git add foo &&
98 (
99 test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
100 git commit
101 ) &&
103 - git config --unset commit.template &&
102 commit_msg_is "new templatecommit message"
103 '
104