From: Eric Sunshine Date: Fri, 21 Mar 2014 20:27:55 GMT Subject: Re: [PATCH 11/12] t0001: drop useless subshells Message-ID: In-Reply-To: <20140320232125.GK8479@sigill.intra.peff.net> On Thu, Mar 20, 2014 at 7:21 PM, Jeff King wrote: > 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 > --- > 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 > @@ -297,30 +286,24 @@ test_expect_success POSIXPERM 'init creates a new deep directory (umask vs. shar > > 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 Broken &&-chain (though, not introduced by this patch). > + 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