Re: [PATCH v2] tests: set temp variables using 'env' in test function instead of subshell

2014-03-19 Thread Junio C Hamano
Jeff King p...@peff.net writes: On Tue, Mar 18, 2014 at 03:16:27PM -0700, Junio C Hamano wrote: Isn't GIT_CONFIG here another way of saying: test_must_fail git config -f doesnotexist --list Perhaps that is shorter and more readable still (and there are a few similar cases in this

[PATCH v2] tests: set temp variables using 'env' in test function instead of subshell

2014-03-18 Thread David Tran
Originally, the code used subshells instead of FOO=BAR command because the variable would otherwise leak into the surrounding context of the POSIX shell when 'command' is a shell function. The subshell was used to hold the context for the test. Using 'env' in the test function sets the temp

Re: [PATCH v2] tests: set temp variables using 'env' in test function instead of subshell

2014-03-18 Thread Junio C Hamano
David Tran unsignedz...@gmail.com writes: Originally, the code used subshells instead of FOO=BAR command because the variable would otherwise leak into the surrounding context of the POSIX shell when 'command' is a shell function. The subshell was used to hold the context for the test. Using

Re: [PATCH v2] tests: set temp variables using 'env' in test function instead of subshell

2014-03-18 Thread Eric Sunshine
On Tue, Mar 18, 2014 at 8:08 AM, David Tran unsignedz...@gmail.com wrote: Originally, the code used subshells instead of FOO=BAR command because the variable would otherwise leak into the surrounding context of the POSIX shell when 'command' is a shell function. The subshell was used to hold

Re: [PATCH v2] tests: set temp variables using 'env' in test function instead of subshell

2014-03-18 Thread Jeff King
On Tue, Mar 18, 2014 at 01:37:39PM -0700, Junio C Hamano wrote: diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index c9c426c..3e3f77b 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -974,24 +974,15 @@ test_expect_success SYMLINKS 'symlinked

Re: [PATCH v2] tests: set temp variables using 'env' in test function instead of subshell

2014-03-18 Thread Junio C Hamano
Jeff King p...@peff.net writes: On Tue, Mar 18, 2014 at 01:37:39PM -0700, Junio C Hamano wrote: diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index c9c426c..3e3f77b 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -974,24 +974,15 @@

Re: [PATCH v2] tests: set temp variables using 'env' in test function instead of subshell

2014-03-18 Thread Eric Sunshine
On Tue, Mar 18, 2014 at 5:45 PM, Jeff King p...@peff.net wrote: On Tue, Mar 18, 2014 at 01:37:39PM -0700, Junio C Hamano wrote: diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index c9c426c..3e3f77b 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@

Re: [PATCH v2] tests: set temp variables using 'env' in test function instead of subshell

2014-03-18 Thread Jeff King
On Tue, Mar 18, 2014 at 03:16:27PM -0700, Junio C Hamano wrote: Isn't GIT_CONFIG here another way of saying: test_must_fail git config -f doesnotexist --list Perhaps that is shorter and more readable still (and there are a few similar cases in this patch. Surely, but are we