Skip to content

Commit 700e006

Browse files
Denton-Lgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a749d01 commit 700e006

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

t/t4014-format-patch.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,10 +1939,9 @@ test_expect_success 'format-patch errors out when history involves criss-cross'
19391939
test_must_fail git format-patch --base=auto -1
19401940
'
19411941

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' '
19441943
git checkout local &&
1945-
git config format.useAutoBase true &&
1944+
test_config format.useAutoBase true &&
19461945
git format-patch --stdout -1 >patch &&
19471946
grep "^base-commit:" patch >actual &&
19481947
git rev-parse upstream >commit-id-base &&
@@ -1951,8 +1950,7 @@ test_expect_success 'format-patch format.useAutoBaseoption' '
19511950
'
19521951

19531952
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 &&
19561954
git format-patch --stdout --base=HEAD~1 -1 >patch &&
19571955
grep "^base-commit:" patch >actual &&
19581956
git rev-parse HEAD~1 >commit-id-base &&

0 commit comments

Comments
 (0)