Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Prefer
/
in bash.exe
path (for fixtures)
Starting in #1712, `gix-testtools` looks for `bash.exe` on Windows in one of its common locations as provided by Git for Windows, by taking the path given by `git --exec-path`, going up by three components, and going down to `bin/bash.exe` under that. But the `bin` and `bash.exe` components were appended in a way that used `\` directory separators. Ordinarily, that would be ideal, since `\` is the primary directory separator on Windows. However, when running `bash` on Windows, the path will either not be directly relevant (because it will turn into something like `/usr/bin/bash` when accessed through the shell itself such as in `$0`), or it will be used in such a way that it may either need to be quoted or appear ambiguous when examined in logs. Furthermore, the path previously mixed `/` and `\` directory separators except in the unusual case that the `GIT_EXEC_PATH` environment variable was set explicitly and its value used `\` separators, since otherwise `git --exec-path` outputs a path with `/` separators. A path with all `/` separators, provided it is a correct path, should be at least as usable as one that mixes `/` and `\`, and may make any error messages where it appears (such as in test failures) more readable. This also refactors for clarity, and adds new tests related to the change.
- Loading branch information