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

[PATCH v1 6/8] t4014: fix tests overwriting cover letter in silent

From
Firmin Martin <firminmartin24@gmail.com>
Date
May 6, 2021, 16:51 UTC
Message-ID
<20210506165102.123739-7-firminmartin24@gmail.com>
In-Reply-To
<20210506165102.123739-1-firminmartin24@gmail.com>

These tests are broken due to the new configuration option format.confirmOvewrite whose the default value requires confirmation from user whenever an existing cover letter is subject to be overwritten.

Also change some pairs of git config and git config --unset to a single test_config.

Signed-off-by: Firmin Martin <firminmartin24@gmail.com>
---
 t/t4014-format-patch.sh | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index cf7e48f4de..a34598beca 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -669,11 +669,13 @@ test_expect_success 'failure to write cover-letter aborts gracefully' '
 '
 
 test_expect_success 'cover-letter inherits diff options' '
+	test_when_finished "rm 0000-cover-letter.patch" &&
 	git mv file foo &&
 	git commit -m foo &&
 	git format-patch --no-renames --cover-letter -1 &&
 	check_patch 0000-cover-letter.patch &&
 	! grep "file => foo .* 0 *\$" 0000-cover-letter.patch &&
+	rm 0000-cover-letter.patch &&
 	git format-patch --cover-letter -1 -M &&
 	grep "file => foo .* 0 *\$" 0000-cover-letter.patch
 '
@@ -1917,10 +1919,9 @@ test_expect_success 'cover letter with nothing' '
 
 test_expect_success 'cover letter auto' '
 	mkdir -p tmp &&
-	test_when_finished "rm -rf tmp;
-		git config --unset format.coverletter" &&
+	test_when_finished "rm -rf tmp" &&
 
-	git config format.coverletter auto &&
+	test_config format.coverletter auto &&
 	git format-patch -o tmp -1 >list &&
 	test_line_count = 1 list &&
 	git format-patch -o tmp -2 >list &&
@@ -1929,10 +1930,10 @@ test_expect_success 'cover letter auto' '
 
 test_expect_success 'cover letter auto user override' '
 	mkdir -p tmp &&
-	test_when_finished "rm -rf tmp;
-		git config --unset format.coverletter" &&
+	test_when_finished "rm -rf tmp" &&
 
-	git config format.coverletter auto &&
+	test_config format.confirmOverwrite never &&
+	test_config format.coverletter auto &&
 	git format-patch -o tmp --cover-letter -1 >list &&
 	test_line_count = 2 list &&
 	git format-patch -o tmp --cover-letter -2 >list &&
@@ -2386,6 +2387,7 @@ test_expect_success 'interdiff: setup' '
 '
 
 test_expect_success 'interdiff: cover-letter' '
+	test_when_finished "rm 0000-cover-letter.patch" &&
 	sed "y/q/ /" >expect <<-\EOF &&
 	+fleep
 	--q
@@ -2398,16 +2400,19 @@ test_expect_success 'interdiff: cover-letter' '
 '
 
 test_expect_success 'interdiff: reroll-count' '
+	test_when_finished "rm v2-0000-cover-letter.patch" &&
 	git format-patch --cover-letter --interdiff=boop~2 -v2 -1 boop &&
 	test_i18ngrep "^Interdiff ..* v1:$" v2-0000-cover-letter.patch
 '
 
 test_expect_success 'interdiff: reroll-count with a non-integer' '
+	test_when_finished "rm v2.2-0000-cover-letter.patch" &&
 	git format-patch --cover-letter --interdiff=boop~2 -v2.2 -1 boop &&
 	test_i18ngrep "^Interdiff:$" v2.2-0000-cover-letter.patch
 '
 
 test_expect_success 'interdiff: reroll-count with a integer' '
+	test_when_finished "rm v2-0000-cover-letter.patch" &&
 	git format-patch --cover-letter --interdiff=boop~2 -v2 -1 boop &&
 	test_i18ngrep "^Interdiff ..* v1:$" v2-0000-cover-letter.patch
 '
-- 
2.31.1.449.g4a44fa8106
Previous: Firmin MartinNext: Firmin Martin
Message 20 of 34 in “format-patch: introduce --confirm-overwrite”
  1. 0/8 format-patch: introduce --confirm-overwriteFirmin Martin, May 6, 2021
  2. 1/8 compat/terminal: let prompt accept input from pipeFirmin Martin, May 6, 2021
  3. Junio C HamanoMay 6, 2021
  4. Jeff KingMay 7, 2021
  5. Junio C HamanoMay 7, 2021
  6. Firmin MartinMay 10, 2021
  7. Jeff KingMay 10, 2021
  8. Junio C HamanoMay 11, 2021
  9. Jeff KingMay 11, 2021
  10. Junio C HamanoMay 11, 2021
  11. Jeff KingMay 11, 2021
  12. 2/8 format-patch: confirmation whenever patches existFirmin Martin, May 6, 2021
  13. Junio C HamanoMay 6, 2021
  14. Firmin MartinMay 10, 2021
  15. Junio C HamanoMay 10, 2021
  16. Firmin MartinMay 11, 2021
  17. 3/8 format-patch: add config option confirmOverwriteFirmin Martin, May 6, 2021
  18. 4/8 format-patch: add the option --confirm-overwriteFirmin Martin, May 6, 2021
  19. 5/8 t4014: test patches overwrite confirmationFirmin Martin, May 6, 2021
  20. 6/8 t4014: fix tests overwriting cover letter in silentFirmin Martin, May 6, 2021
  21. 7/8 doc/format-patch: describe --confirm-overwriteFirmin Martin, May 6, 2021
  22. Bagas SanjayaMay 7, 2021
  23. Firmin MartinMay 10, 2021
  24. 8/8 config/format: describe format.confirmOverwriteFirmin Martin, May 6, 2021
  25. Junio C HamanoMay 6, 2021
  26. Firmin MartinMay 11, 2021
  27. Felipe ContrerasMay 7, 2021
  28. Denton LiuMay 7, 2021
  29. Firmin MartinMay 11, 2021
  30. Felipe ContrerasMay 11, 2021
  31. Felipe ContrerasMay 11, 2021
  32. Sergey OrganovMay 7, 2021
  33. Firmin MartinMay 11, 2021
  34. Ævar Arnfjörð BjarmasonMay 10, 2021

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.