[PATCH 11/12] t0001: drop useless subshells

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Many tests use subshells, but don't actually change the
shell environment. They were probably cargo-culted from
earlier tests which did need subshells. Drop the useless
ones.

Signed-off-by: Jeff King <peff@xxxxxxxx>
---
These ones should produce no behavior change at all; they're purely
mechanical "(foo && bar)" to "foo && bar" (though of course I did them
by hand, because you need to know that "foo" and "bar" do not affect the
environment).

 t/t0001-init.sh | 61 +++++++++++++++++++++------------------------------------
 1 file changed, 22 insertions(+), 39 deletions(-)

diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index 4560bba..55a68bc 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -106,11 +106,8 @@ test_expect_success 'plain bare with GIT_WORK_TREE' '
 '
 
 test_expect_success 'GIT_DIR bare' '
-
-	(
-		mkdir git-dir-bare.git &&
-		GIT_DIR=git-dir-bare.git git init
-	) &&
+	mkdir git-dir-bare.git &&
+	GIT_DIR=git-dir-bare.git git init &&
 	check_config git-dir-bare.git true unset
 '
 
@@ -242,36 +239,28 @@ test_expect_success 'init rejects insanely long --template' '
 
 test_expect_success 'init creates a new directory' '
 	rm -fr newdir &&
-	(
-		git init newdir &&
-		test_path_is_dir newdir/.git/refs
-	)
+	git init newdir &&
+	test_path_is_dir newdir/.git/refs
 '
 
 test_expect_success 'init creates a new bare directory' '
 	rm -fr newdir &&
-	(
-		git init --bare newdir &&
-		test_path_is_dir newdir/refs
-	)
+	git init --bare newdir &&
+	test_path_is_dir newdir/refs
 '
 
 test_expect_success 'init recreates a directory' '
 	rm -fr newdir &&
-	(
-		mkdir newdir &&
-		git init newdir &&
-		test_path_is_dir newdir/.git/refs
-	)
+	mkdir newdir &&
+	git init newdir &&
+	test_path_is_dir newdir/.git/refs
 '
 
 test_expect_success 'init recreates a new bare directory' '
 	rm -fr newdir &&
-	(
-		mkdir newdir &&
-		git init --bare newdir &&
-		test_path_is_dir newdir/refs
-	)
+	mkdir newdir &&
+	git init --bare newdir &&
+	test_path_is_dir newdir/refs
 '
 
 test_expect_success 'init creates a new deep directory' '
@@ -297,30 +286,24 @@ test_expect_success POSIXPERM 'init creates a new deep directory (umask vs. shar
 
 test_expect_success 'init notices EEXIST (1)' '
 	rm -fr newdir &&
-	(
-		>newdir &&
-		test_must_fail git init newdir &&
-		test_path_is_file newdir
-	)
+	>newdir &&
+	test_must_fail git init newdir &&
+	test_path_is_file newdir
 '
 
 test_expect_success 'init notices EEXIST (2)' '
 	rm -fr newdir &&
-	(
-		mkdir newdir &&
-		>newdir/a
-		test_must_fail git init newdir/a/b &&
-		test_path_is_file newdir/a
-	)
+	mkdir newdir &&
+	>newdir/a
+	test_must_fail git init newdir/a/b &&
+	test_path_is_file newdir/a
 '
 
 test_expect_success POSIXPERM,SANITY 'init notices EPERM' '
 	rm -fr newdir &&
-	(
-		mkdir newdir &&
-		chmod -w newdir &&
-		test_must_fail git init newdir/a/b
-	)
+	mkdir newdir &&
+	chmod -w newdir &&
+	test_must_fail git init newdir/a/b
 '
 
 test_expect_success 'init creates a new bare directory with global --bare' '
-- 
1.9.0.560.g01ceb46

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]