Re: Crash on MSYS2 with GIT_WORK_TREE
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Mar 8, 2017, 12:03 UTC
- Message-ID
- <alpine.DEB.2.20.1703081259150.3767@virtualbox>
- In-Reply-To
- <CAFKRc7ysOAOVx-7ww7MLF1qKpuKdJQqAtAhLJcYh3yMD3G2ncA@mail.gmail.com>
Hi valtron,
On Tue, 7 Mar 2017, valtron wrote:
> I only ran into this because of git-gui, where I eventually tracked it > down to line 1330: > > set env(GIT_WORK_TREE) $_gitworktree
As git-gui is a Tcl script, which in turn runs as a pure Windows application, the path should use backslashes.
> With that line commented out, it works. I'll look into why git-gui > sets it to a windows-path-with-forward-slashes, but that's a separate > issue from the crash.
It is... please do contribute your fix when you have one.
> Also, from the stack trace, I think git is still able to understand the > path, since it appears to correctly convert it to /c/repo, but I might > be wrong since I haven't look at the code.
Git does not convert the path at all. It is the *MSYS2 runtime* that converts Windows paths to POSIX paths, if any. And it does so selectively. The current working directory is always transformed. PATH is always transformed. Environment variables are transformed *when they look like Windows paths*. And I am fairly certain that a GIT_WORK_TREE with a colon and forward-slashes fails that test: the MSYS2 runtime thinks this is not a Windows path and leaves it alone. Enter your problem.
Ciao, Johannes