Re: [PATCH 11/12] t0001: drop useless subshells
On Thu, Mar 20, 2014 at 7:21 PM, Jeff King <peff@peff.net> wrote:
Show 31 quoted lines
> 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@peff.net>
> ---
> 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).
Show 19 quoted lines
> + 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