Re: [PATCH 2/3] t0033-safe-directory: check when 'safe.directory' is ignored

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

 



On 5/10/22 3:55 PM, Taylor Blau wrote:
On Tue, May 10, 2022 at 08:33:21PM +0200, SZEDER Gábor wrote:
On Fri, Apr 29, 2022 at 03:19:01PM -0400, Derrick Stolee wrote:
Would it be simpler to use this?

	GIT_TEST_ASSUME_DIFFERENT_USER=0 git config --unset safe.directory

Oh, wow.  This is so obvious, no wonder it didn't occur to me :)

Don't we consider this one-shot environment variable to be sticky on
some shells (i.e., that it persists beyond just the "git config"
invocation here)?

Almost. Some old/buggy shells incorrectly allow the one-shot environment variable assignment to bleed past command invocation when the "command" is a shell function, like this:

    SOME_ENV_VAR=somevalue shell_function_call

We do "lint"[*] for that sort of problem in t/check-non-portable-shell.pl.

Stolee's example, however, is invoking a normal program (`git`, in this case), so isn't subject to that unwanted behavior from buggy shells.


[*]: a0a630192d (t/check-non-portable-shell: detect "FOO=bar shell_func", 2018-07-13)



[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]

  Powered by Linux