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

[PATCH 2/2] t5510: do not leave changed cwd

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Mar 4, 2016, 10:53 UTC
Message-ID
<f6499302a5dfb52bf6c9430581103da9569434a3.1457088499.git.git@drmicha.warpmail.net>
In-Reply-To
<cover.1457088499.git.git@drmicha.warpmail.net>

t5510 carefully keeps the cwd at the test root by using either subshells or explicit cd'ing back to the root. Use a subshell for the last subtest, too.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
 t/t5510-fetch.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 0c10c85..38321d1 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -679,10 +679,12 @@ test_expect_success 'fetching with auto-gc does not lock up' '
 	EOF
 	git clone "file://$D" auto-gc &&
 	test_commit test2 &&
-	cd auto-gc &&
-	git config gc.autoPackLimit 1 &&
-	GIT_ASK_YESNO="$D/askyesno" git fetch >fetch.out 2>&1 &&
-	! grep "Should I try again" fetch.out
+	(
+		cd auto-gc &&
+		git config gc.autoPackLimit 1 &&
+		GIT_ASK_YESNO="$D/askyesno" git fetch >fetch.out 2>&1 &&
+		! grep "Should I try again" fetch.out
+	)
 '
 
 test_done
-- 
2.8.0.rc0.181.g163d81c
Previous: Jeff KingNext: Jeff King
Message 6 of 9 in “Test trash dir sanitizing”
  1. 0/2 Test trash dir sanitizingMichael J Gruber, Mar 4, 2016
  2. 1/2 test-lib: quote TRASH_DIRECTORYMichael J Gruber, Mar 4, 2016
  3. Jeff KingMar 4, 2016
  4. Michael J GruberMar 4, 2016
  5. Jeff KingMar 4, 2016
  6. 2/2 t5510: do not leave changed cwdMichael J Gruber, Mar 4, 2016
  7. Jeff KingMar 4, 2016
  8. Michael J GruberMar 4, 2016
  9. Junio C HamanoMar 4, 2016

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.