@matheusbsbs / matheus-bagliano / commits / 700e006c5d
Fork 0

t4014: use test_config()

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>

Denton Liu committed Dec 4, 2019 at 13:25 UTC 700e006c5d69990fc1167355e9fa7a55e9166581
1 file changed +3 -5
t/t4014-format-patch.sh
+3 -5
@@ -1939,10 +1939,9 @@ test_expect_success 'format-patch errors out when history involves criss-cross'
1939 test_must_fail git format-patch --base=auto -1
1940 '
1941
1942 -test_expect_success 'format-patch format.useAutoBaseoption' '
1943 - test_when_finished "git config --unset format.useAutoBase" &&
1942 +test_expect_success 'format-patch format.useAutoBase option' '
1943 git checkout local &&
1945 - git config format.useAutoBase true &&
1944 + test_config format.useAutoBase true &&
1945 git format-patch --stdout -1 >patch &&
1946 grep "^base-commit:" patch >actual &&
1947 git rev-parse upstream >commit-id-base &&
@@ -1951,8 +1950,7 @@ test_expect_success 'format-patch format.useAutoBaseoption' '
1950 '
1951
1952 test_expect_success 'format-patch --base overrides format.useAutoBase' '
1954 - test_when_finished "git config --unset format.useAutoBase" &&
1955 - git config format.useAutoBase true &&
1953 + test_config format.useAutoBase true &&
1954 git format-patch --stdout --base=HEAD~1 -1 >patch &&
1955 grep "^base-commit:" patch >actual &&
1956 git rev-parse HEAD~1 >commit-id-base &&