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

[PATCH 1/5] t7610: don't use test_config in a subshell

From
John Keeping <john@keeping.me.uk>
Date
Sep 5, 2015, 13:12 UTC
Message-ID
<dc4119cc27db2636dfefdd9045161fe47302f780.1441458341.git.john@keeping.me.uk>
In-Reply-To
<cover.1441458341.git.john@keeping.me.uk>

test_config uses test_when_finished to reset the configuration after the test, but this does not work inside a subshell. This does not cause a problem here because the first thing the next test does is to set this config variable itself, but we are about to add a check that will complain when test_when_finished is used in a subshell.

In this case, "subdir" not a submodule so test_config has the same effect when run at the top level and can simply be moved out of the subshell.

Signed-off-by: John Keeping <john@keeping.me.uk>
---
 t/t7610-mergetool.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh
index 7eeb207..6f12b23 100755
--- a/t/t7610-mergetool.sh
+++ b/t/t7610-mergetool.sh
@@ -174,9 +174,9 @@ test_expect_success 'mergetool skips autoresolved' '
 '
 
 test_expect_success 'mergetool merges all from subdir' '
+	test_config rerere.enabled false &&
 	(
 		cd subdir &&
-		test_config rerere.enabled false &&
 		test_must_fail git merge master &&
 		( yes "r" | git mergetool ../submod ) &&
 		( yes "d" "d" | git mergetool --no-prompt ) &&
-- 
2.5.0.466.g9af26fa
Previous: John KeepingNext: John Keeping
Message 5 of 15 in “[RFC] test_when_finished in subshells”
  1. John KeepingSep 4, 2015
  2. Junio C HamanoSep 4, 2015
  3. Jeff KingSep 5, 2015
  4. 0/5 disallow test_when_finished in subshellsJohn Keeping, Sep 5, 2015
  5. 1/5 t7610: don't use test_config in a subshellJohn Keeping, Sep 5, 2015
  6. 2/5 t5801: don't use test_when_finished in a subshellJohn Keeping, Sep 5, 2015
  7. 3/5 test-lib-functions: support "test_config -C <dir> ..."John Keeping, Sep 5, 2015
  8. 4/5 t7800: don't use test_config in a subshellJohn Keeping, Sep 5, 2015
  9. 5/5 test-lib-functions: detect test_when_finished in subshellJohn Keeping, Sep 5, 2015
  10. Eric SunshineSep 6, 2015
  11. John KeepingSep 6, 2015
  12. Eric SunshineSep 6, 2015
  13. Junio C HamanoSep 5, 2015
  14. John KeepingSep 5, 2015
  15. Junio C HamanoSep 5, 2015

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.