git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v4 3/5] t4014: use test_config()

From
Denton Liu <liu.denton@gmail.com>
Date
Dec 4, 2019, 21:25 UTC
Message-ID
<a55eacbad7ca0f15d038fa61d33190b1beb663a7.1575494618.git.liu.denton@gmail.com>
In-Reply-To
<cover.1575494617.git.liu.denton@gmail.com>

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>
---
 t/t4014-format-patch.sh | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 69267b16f0..c7cc643adf 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 &&
-- 
2.24.0.578.g4820254054
Previous: Denton LiuNext: Denton Liu
Message 31 of 33 in “Bug with "git rebase" when format.useAutoBase is set”
  1. Christian BiesingerNov 26, 2019
  2. 0/5 rebase: fix breakage with `format.useAutoBase`Denton Liu, Nov 27, 2019
  3. 1/5 t3400: demonstrate failure with format.useAutoBaseDenton Liu, Nov 27, 2019
  4. Eric SunshineNov 27, 2019
  5. Junio C HamanoNov 30, 2019
  6. 2/5 format-patch: fix indentationDenton Liu, Nov 27, 2019
  7. 3/5 t4014: use `test_config`Denton Liu, Nov 27, 2019
  8. 4/5 format-patch: teach --no-baseDenton Liu, Nov 27, 2019
  9. 5/5 rebase: fix `format.useAutoBase` breakageDenton Liu, Nov 27, 2019
  10. Eric SunshineNov 27, 2019
  11. Christian BiesingerNov 27, 2019
  12. 0/5 rebase: fix breakage with `format.useAutoBase`Denton Liu, Nov 27, 2019
  13. 1/5 t3400: demonstrate failure with format.useAutoBaseDenton Liu, Nov 27, 2019
  14. 2/5 format-patch: fix indentationDenton Liu, Nov 27, 2019
  15. 3/5 t4014: use test_config()Denton Liu, Nov 27, 2019
  16. 4/5 format-patch: teach --no-baseDenton Liu, Nov 27, 2019
  17. Denton LiuNov 27, 2019
  18. 5/5 rebase: fix format.useAutoBase breakageDenton Liu, Nov 27, 2019
  19. Christian BiesingerDec 4, 2019
  20. 0/5 rebase: fix breakage with `format.useAutoBase`Denton Liu, Dec 4, 2019
  21. 1/5 t3400: demonstrate failure with format.useAutoBaseDenton Liu, Dec 4, 2019
  22. 2/5 format-patch: fix indentationDenton Liu, Dec 4, 2019
  23. 4/5 format-patch: teach --no-baseDenton Liu, Dec 4, 2019
  24. René ScharfeDec 4, 2019
  25. Junio C HamanoDec 4, 2019
  26. 3/5 t4014: use test_config()Denton Liu, Dec 4, 2019
  27. 5/5 rebase: fix format.useAutoBase breakageDenton Liu, Dec 4, 2019
  28. 0/5 rebase: fix breakage with `format.useAutoBase`Denton Liu, Dec 4, 2019
  29. 1/5 t3400: demonstrate failure with format.useAutoBaseDenton Liu, Dec 4, 2019
  30. 2/5 format-patch: fix indentationDenton Liu, Dec 4, 2019
  31. 3/5 t4014: use test_config()Denton Liu, Dec 4, 2019
  32. 4/5 format-patch: teach --no-baseDenton Liu, Dec 4, 2019
  33. 5/5 rebase: fix format.useAutoBase breakageDenton Liu, Dec 4, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.