bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] Clean environment for GIT test


From: Eric Blake
Subject: Re: [PATCH] Clean environment for GIT test
Date: Mon, 15 Mar 2010 19:03:07 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b1 Thunderbird/3.0.3

On 03/15/2010 09:20 AM, Bert Wesarg wrote:
> Unset GIT_DIR and GIT_WORK_TREE environment variable in test
> test-vc-list-files-git.sh.
> 
> ---
> diff --git i/tests/test-vc-list-files-git.sh w/tests/test-vc-list-files-git.sh
> --- i/tests/test-vc-list-files-git.sh
> +++ w/tests/test-vc-list-files-git.sh
> @@ -28,6 +28,9 @@ tmpdir=vc-git-$$
>  trap 'st=$?; cd '"`pwd`"' && rm -rf $tmpdir; exit $st' 0
>  trap '(exit $?); exit $?' 1 2 13 15
> 
> +unset GIT_DIR
> +unset GIT_WORK_TREE
> +
>  fail=1
>  mkdir $tmpdir && cd $tmpdir &&
>   # without git, skip the test

Thanks for the patch.  This needs to be flowed upstream to gnulib.
Furthermore, some portability nits:

If you want to be portable to bash 2.04, then you have to ensure that
GIT_DIR and GIT_WORK_TREE are set (there, unset dumps core if used on
variables that are not set).  Also, this can be done in one unset
instead of two:

GIT_DIR= GIT_WORK_TREE=; unset GIT_DIR GIT_WORK_TREE

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]