Re: [PATCH] HOME must be set before calling git-init when creating test repositories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

and not have to worry about checking $root at all.

Sorry for the confusion.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]