Skip to content

Commit 55f6be2

Browse files
committed
Instrument make_remote_repos.sh to view config corruption
The change in the previous commit of switching to the non-shim `bash.exe` in `(git root)/usr/bin` causes problems, because the environment may not be correct for shell commands and scripts. In particular, the `PATH` might not enable standard POSIX tools to be found, or the tools that are found may interoperate incorrectly with the shell. The latter caused failures in #1862 in an analogous choice of `sh.exe`, which were addressed by preferring the shim when available. See: - #1862 (comment) Here, 90 tests started to fail when the test suite was run locally from PowerShell (i.e. not a Git Bash environment) on a Windows 10 system that, in addition to a full Git for Windows installation, contains a separate non-GfW MSYS2 installation whose `bin` directories are in `PATH` even in non-MSYS2 environments. The failures were described, and most of them investigated, as follows: - #1864 (comment) - https://gist.github.com/EliahKagan/3c5eebd091e66d8c912fddbce0a064cd - https://gist.github.com/EliahKagan/17066ad1f7b0aa98e4fdf4642abe1d93 Most failures, including all those that were unintuitive, were directly or indirectly due to the `make_remote_repos.sh` fixture script encountering the error: fatal: bad config line 10 in file ./config This happened due to the same incorrect behavior of `>>`, when used by a shell that links to one `msys-2.0.dll` running a program that links to a different `msys-2.0.dll` of another version or build, as caused the failure encountered with the non-shim in #1862. (It may be the handful of other failures are also caused by this `>>` problem, but as of now that has not been examined.) This commit temporarily instruments that fixture script so that, when tests are run, the observations and analysis in the last gist above can be confirmed. (These changes are also shown there.)
1 parent 853b718 commit 55f6be2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gix/tests/fixtures/make_remote_repos.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
set -eu -o pipefail
2+
set -eux -o pipefail
33

44
function tick () {
55
if test -z "${tick+set}"
@@ -190,6 +190,7 @@ git init --bare bad-url-rewriting
190190
(cd bad-url-rewriting
191191

192192
git remote add origin https://github.com/foobar/gitoxide
193+
nl -ba config >&2
193194
cat <<EOF >> config
194195
195196
[remote "origin"]
@@ -201,6 +202,7 @@ git init --bare bad-url-rewriting
201202
[url "https://github.com/byron/"]
202203
insteadOf = https://github.com/foobar/
203204
EOF
205+
nl -ba config >&2
204206

205207
{
206208
git remote get-url origin

0 commit comments

Comments
 (0)