summaryrefslogtreecommitdiff
path: root/t/t4014-format-patch.sh
diff options
context:
space:
mode:
authorDenton Liu <liu.denton@gmail.com>2019-12-04 21:25:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-12-05 14:06:18 (GMT)
commit700e006c5d69990fc1167355e9fa7a55e9166581 (patch)
tree5863d9c1a0ebda55ecf98cf7fc66c471e5222448 /t/t4014-format-patch.sh
parenta749d01e1d9a91b96b00f4eee411c20e20e662b5 (diff)
downloadgit-700e006c5d69990fc1167355e9fa7a55e9166581.zip
git-700e006c5d69990fc1167355e9fa7a55e9166581.tar.gz
git-700e006c5d69990fc1167355e9fa7a55e9166581.tar.bz2
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>
Diffstat (limited to 't/t4014-format-patch.sh')
-rwxr-xr-xt/t4014-format-patch.sh8
1 files changed, 3 insertions, 5 deletions
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 69267b1..c7cc643 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -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 &&