From: Johannes Sixt Date: Sun, 17 Apr 2016 15:05:33 GMT Subject: Re: [PATCH v2 2/2] t1500-rev-parse: rewrite each test to run in isolation Message-ID: <5713A63D.3060200@kdbg.org> In-Reply-To: <20160417055955.GA13384@flurp.local> Am 17.04.2016 um 07:59 schrieb Eric Sunshine: > On Sat, Apr 16, 2016 at 12:13:50PM -0400, Michael Rappazzo wrote: >> +test_expect_success 'GIT_DIR=../.git, core.bare = false: prefix' ' >> + mkdir work && >> + test_when_finished "rm -rf work" && >> + test_config -C "$(pwd)"/.git core.bare false && >> + GIT_DIR=../.git test_stdout "" git -C work rev-parse --show-prefix >actual > > Drop the unnecessary '>actual' redirection. Not only that: setting an environment variable in front of a shell function invocation keeps the variable's value in some (most?) shells. This occurs frequently in the new code. I don't know whether we have a shorter pattern than ( GIT_DIR=../.git && export GIT_DIR && test_stdout "" git -C work rev-parse --show-prefix ) -- Hannes