From: Alex Riesen Date: Sat, 26 Mar 2011 18:42:14 GMT Subject: Re: [PATCH] HOME must be set before calling git-init when creating test repositories Message-ID: In-Reply-To: <20110326183102.GA3796@sigill.intra.peff.net> On Sat, Mar 26, 2011 at 19:31, Jeff King wrote: > On Sat, Mar 26, 2011 at 07:21:26PM +0100, Alex Riesen wrote: > >> > No, it's totally broken. $(pwd)/$test is nonsensical. The code right >> > above your change guarantees that $test is an absolute path, either >> > because the user gave us an absolute $root or because it has been >> > prepended with $TEST_DIRECTORY (which itself comes from $(pwd)). >> >> I see. I mistook "$root" for the root of a filesystem, not the variable in >> test-lib.sh. How about this, than? > > Oops, when I said "$test" I meant to say $TRASH_DIRECTORY. That is, > $TRASH_DIRECTORY is always the absolute path to the trash. > >> +HOME="$(pwd)/$test" >> +test -n "$root" && HOME="$test" >> +export HOME > > So you can simplify this to just: > > HOME=$TRASH_DIRECTORY > Aah... I should have actually looked at the "case" which sets TRASH_DIRECTORY! Will resend in a moment.