OSDN Git Service

t9500: use test_config to set/unset git config variables
authorYann Droneaud <ydroneaud@opteya.com>
Sun, 24 Mar 2013 21:06:13 +0000 (22:06 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Mar 2013 15:50:54 +0000 (08:50 -0700)
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>
t/t9500-gitweb-standalone-no-errors.sh

index 90bb605..6783c14 100755 (executable)
@@ -539,8 +539,7 @@ test_expect_success \
         test_when_finished "GIT_COMMITTER_NAME=\"C O Mitter\"" &&
         echo "ISO-8859-1" >> file &&
         git add file &&
-        git config i18n.commitencoding ISO-8859-1 &&
-        test_when_finished "git config --unset i18n.commitencoding" &&
+        test_config i18n.commitencoding ISO-8859-1 &&
         git commit -F "$TEST_DIRECTORY"/t3900/ISO8859-1.txt &&
         gitweb_run "p=.git;a=commit"'