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

[PATCH 13/14] git p4 test: keep P4CLIENT changes inside subshells

From
PWPete Wyckoff <pw@padd.com>
Date
Jan 15, 2013, 00:47 UTC
Message-ID
<1358210828-2369-14-git-send-email-pw@padd.com>
In-Reply-To
<1358210828-2369-1-git-send-email-pw@padd.com>

Tests assume that this is set to something valid. Make sure that the 'clone --use-client-spec' does not leak its changes out into the rest of the tests.

Signed-off-by: Pete Wyckoff <pw@padd.com>
---
 t/t9806-git-p4-options.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/t/t9806-git-p4-options.sh b/t/t9806-git-p4-options.sh
index 3b0000f..8d914a5 100755
--- a/t/t9806-git-p4-options.sh
+++ b/t/t9806-git-p4-options.sh
@@ -226,9 +226,11 @@ test_expect_success 'clone --use-client-spec' '
 		View: //depot/sub/... //client2/bus/...
 		EOF
 	) &&
-	P4CLIENT=client2 &&
 	test_when_finished cleanup_git &&
-	git p4 clone --dest="$git" --use-client-spec //depot/... &&
+	(
+		P4CLIENT=client2 &&
+		git p4 clone --dest="$git" --use-client-spec //depot/...
+	) &&
 	(
 		cd "$git" &&
 		test_path_is_file bus/dir/f4 &&
@@ -241,6 +243,7 @@ test_expect_success 'clone --use-client-spec' '
 		cd "$git" &&
 		git init &&
 		git config git-p4.useClientSpec true &&
+		P4CLIENT=client2 &&
 		git p4 sync //depot/... &&
 		git checkout -b master p4/master &&
 		test_path_is_file bus/dir/f4 &&
-- 
1.8.1.350.gdbf6fd0
Previous: Pete WyckoffNext: Pete Wyckoff
Message 14 of 15 in “git p4 branch handling fixes”
  1. 00/14 git p4 branch handling fixesPete Wyckoff, Jan 15, 2013
  2. 01/14 git p4: test sync/clone --branch behaviorPete Wyckoff, Jan 15, 2013
  3. 02/14 git p4: rearrange and simplify hasOrigin handlingPete Wyckoff, Jan 15, 2013
  4. 03/14 git p4: add comments to p4BranchesInGitPete Wyckoff, Jan 15, 2013
  5. 04/14 git p4: inline listExistingP4GitBranchesPete Wyckoff, Jan 15, 2013
  6. 05/14 git p4: create p4/HEAD on initial clonePete Wyckoff, Jan 15, 2013
  7. 06/14 git p4: verify expected refs in clone --bare testPete Wyckoff, Jan 15, 2013
  8. 07/14 git p4: clone --branch should checkout masterPete Wyckoff, Jan 15, 2013
  9. 08/14 git p4 doc: fix branch detection examplePete Wyckoff, Jan 15, 2013
  10. 09/14 git p4: allow short ref names to --branchPete Wyckoff, Jan 15, 2013
  11. 10/14 git p4: rearrange self.initialParent usePete Wyckoff, Jan 15, 2013
  12. 11/14 git p4: fail gracefully on sync with no master branchPete Wyckoff, Jan 15, 2013
  13. 12/14 git p4: fix sync --branch when no master branchPete Wyckoff, Jan 15, 2013
  14. 13/14 git p4 test: keep P4CLIENT changes inside subshellsPete Wyckoff, Jan 15, 2013
  15. 14/14 git p4: fix submit when no master branchPete Wyckoff, Jan 15, 2013

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.