]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t4014: use test_config()
authorDenton Liu <liu.denton@gmail.com>
Wed, 4 Dec 2019 21:25:00 +0000 (13:25 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 5 Dec 2019 14:06:18 +0000 (06:06 -0800)
Instead of manually unsetting the config after the test case is done,
use test_config() to do it automatically. While we're at it, fix a typo
in a test case name.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4014-format-patch.sh

index 69267b16f0baccc642ed3c7a4692b1a0c415d478..c7cc643adf09a8a59491ab997ec53c175f8445b3 100755 (executable)
@@ -1939,10 +1939,9 @@ test_expect_success 'format-patch errors out when history involves criss-cross'
        test_must_fail  git format-patch --base=auto -1
 '
 
-test_expect_success 'format-patch format.useAutoBaseoption' '
-       test_when_finished "git config --unset format.useAutoBase" &&
+test_expect_success 'format-patch format.useAutoBase option' '
        git checkout local &&
-       git config format.useAutoBase true &&
+       test_config format.useAutoBase true &&
        git format-patch --stdout -1 >patch &&
        grep "^base-commit:" patch >actual &&
        git rev-parse upstream >commit-id-base &&
@@ -1951,8 +1950,7 @@ test_expect_success 'format-patch format.useAutoBaseoption' '
 '
 
 test_expect_success 'format-patch --base overrides format.useAutoBase' '
-       test_when_finished "git config --unset format.useAutoBase" &&
-       git config format.useAutoBase true &&
+       test_config format.useAutoBase true &&
        git format-patch --stdout --base=HEAD~1 -1 >patch &&
        grep "^base-commit:" patch >actual &&
        git rev-parse HEAD~1 >commit-id-base &&