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
fix: Omit system/global config in fixtures regardless of contents
This uses the null device, `/dev/null` on Unix-like systems and
`NUL` on Windows, as the value of `GIT_CONFIG_SYSTEM` and
`GIT_CONFIG_GLOBAL` when `gix-testtols` runs test fixture shell
scripts.
`/dev/null` is explicitly recommended for this purpose, when
setting those environment variables for the purpose of preventing
configuration files from being read, in the Git documentation:
- https://git-scm.com/docs/git#Documentation/git.txt-codeGITCONFIGGLOBALcode
On Windows, `NUL` is an analogue of `/dev/null`. Even in the
unusual scenario that a `\\?\` prefixed UNC path is used to create
an actual file named `NUL` in the directory the fixture script
operates in, the relative path `NUL` still resolves to the null
device and not to that file.
The previous behavior was to use a value of `:` on Unix-like
systems or `-` on Windows. But these were really just unusual but
valid paths, such that files of those names could exist in any
location. `git` furthermore treats them as paths: a `:` is not
special in these environment variables because they hold a single
path rather than a list of paths, and a `-` is not special (for
example, it does not specify stdin) because it appears in an
environment variable rather than a command-line argument.
While `:` and `-` are unusual filenames, this code is used in
testing, including of edge cases where unusual files may be used.
So this change may make the test tools slightly more robust.
0 commit comments