Re: [PATCH] HOME must be set before calling git-init when creating test repositories
- From
Jeff King <peff@peff.net>
- Date
- Mar 26, 2011, 18:31 UTC
- Message-ID
- <20110326183102.GA3796@sigill.intra.peff.net>
- In-Reply-To
- <20110326182126.GA13496@blimp.localdomain>
On Sat, Mar 26, 2011 at 07:21:26PM +0100, Alex Riesen wrote:
Show 7 quoted lines
> > 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
and not have to worry about checking $root at all.
Sorry for the confusion.
-Peff