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

[PATCH] t3404 & t7508: cd inside subshell instead of around

From
Jens Lehmann <jens.lehmann@web.de>
Date
Sep 6, 2010, 18:41 UTC
Message-ID
<4C8535C2.5050203@web.de>

Fixed all places where it was a straightforward change from cd'ing into a directory and back via "cd .." to a cd inside a subshell.

Found these places with "git grep -w "cd \.\.".
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
---

This patch applies on top of master and contains the changes that don't apply to maint.

 t/t3404-rebase-interactive.sh |    6 +++---
 t/t7508-status.sh             |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index af3b663..7d20a74 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -101,10 +101,10 @@ test_expect_success 'rebase -i with the exec command' '

 test_expect_success 'rebase -i with the exec command runs from tree root' '
 	git checkout master &&
-	mkdir subdir && cd subdir &&
+	mkdir subdir && (cd subdir &&
 	FAKE_LINES="1 exec_>touch-subdir" \
-		git rebase -i HEAD^ &&
-	cd .. &&
+		git rebase -i HEAD^
+	) &&
 	test_path_is_file touch-subdir &&
 	rm -fr subdir
 '
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index 18b07d9..c9300f3 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -808,7 +808,7 @@ test_expect_success POSIXPERM,SANITY 'status succeeds in a read-only repository'
 	(exit $status)
 '

-(cd sm && echo > bar && git add bar && git commit -q -m 'Add bar' && cd .. && git add sm)
+(cd sm && echo > bar && git add bar && git commit -q -m 'Add bar') && git add sm
 new_head=$(cd sm && git rev-parse --short=7 --verify HEAD)
 touch .gitmodules
-- 
1.7.3.rc0.181.g885f40
Message 1 of 1 in “t3404 & t7508: cd inside subshell instead of around”
  1. t3404 & t7508: cd inside subshell instead of aroundJens Lehmann, Sep 6, 2010

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.