You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that, when `GIT_DIR` is set to a location `git` cannot read
any repository information from, then `GIT_COMMON_DIR` is not used
for "common" parts like `config` either. But I haven't found this
documented anywhere and I'm not sure it's guaranteed. So this
unsets `GIT_COMMON_DIR`, to avoid reading local-scope configuration
for any repository.
This also unsets `GIT_DISCOVERY_ACROSS_FILESYSTEM`, which shouldn't
be necessary to avoid reading local configuration, but I think at
least some versions of Git on some systems will traverse upward
from the current directory even when `GIT_DIR` is specified (even
though they won't consider us to be in a repository found in the
traversal). Unsetting it causes the default of false to be used.
This still does not clear all or most of the environment, nor does
it attempt to unset all variables that affect `git` behavior,
because some variables should be honored to change what we regard
to be the configuration associated with the installation, e.g.,
`GIT_CONFIG_SYSTEM`, while others should be honored for debugging
related effects.
0 commit comments