diff mbox series

[v6,4/5,Outreachy] t7201: use 'git -C' to avoid subshell

Message ID 20201022071649.24284-5-charvi077@gmail.com (mailing list archive)
State Accepted
Commit 627f2d79de1ac0d5a1cdf6a9dcf5c95e17b77b3a
Headers show
Series modernize the test scripts | expand

Commit Message

Charvi Mendiratta Oct. 22, 2020, 7:16 a.m. UTC
Signed-off-by: Charvi Mendiratta <charvi077@gmail.com>
---
 t/t7201-co.sh | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index 74553f991b..5898182fd2 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -339,10 +339,7 @@  test_expect_success 'switch branches while in subdirectory' '
 	git checkout master &&
 
 	mkdir subs &&
-	(
-		cd subs &&
-		git checkout side
-	) &&
+	git -C subs checkout side &&
 	! test -f subs/one &&
 	rm -fr subs
 '
@@ -357,10 +354,7 @@  test_expect_success 'checkout specific path while in subdirectory' '
 
 	git checkout master &&
 	mkdir -p subs &&
-	(
-		cd subs &&
-		git checkout side -- bero
-	) &&
+	git -C subs checkout side -- bero &&
 	test -f subs/bero
 '