t4034: use test_config/test_unconfig 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. Additionally, instead of git config <key> "" or git config --unset <key> uses test_unconfig <key> The latter doesn't failed if <key> is not defined. 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 ff73aa405fdbaa1073b4ada09ba3c151a255d826
1 file changed +3 -4
t/t4034-diff-words.sh
+3 -4
@@ -230,7 +230,7 @@ test_expect_success '.gitattributes override config' '
230 '
231
232 test_expect_success 'setup: remove diff driver regex' '
233 - test_might_fail git config --unset diff.testdriver.wordRegex
233 + test_unconfig diff.testdriver.wordRegex
234 '
235
236 test_expect_success 'use configured regex' '
@@ -335,8 +335,7 @@ test_expect_success 'word-diff with diff.sbe' '
335
336 c
337 EOF
338 - test_when_finished "git config --unset diff.suppress-blank-empty" &&
339 - git config diff.suppress-blank-empty true &&
338 + test_config diff.suppress-blank-empty true &&
339 word_diff --word-diff=plain
340 '
341
@@ -368,7 +367,7 @@ test_expect_success 'setup history with two files' '
367
368 test_expect_success 'wordRegex for the first file does not apply to the second' '
369 echo "*.tex diff=tex" >.gitattributes &&
371 - git config diff.tex.wordRegex "[a-z]+|." &&
370 + test_config diff.tex.wordRegex "[a-z]+|." &&
371 cat >expect <<-\EOF &&
372 diff --git a/a.tex b/a.tex
373 --- a/a.tex