Skip to content

Conversation

@bk2204
Copy link
Member

@bk2204 bk2204 commented Sep 7, 2022

The cygpath binary from Git for Windows has a bug: when the path contains braces, apostrophes, or certain other special characters, it strips them out when called from Go, but not from the command line.

This results in us having broken behaviour with those characters in the current working directory. To address this, no longer consider MINGW to be a Cygwin-like environment.

Fixes #5105
Fixes #4829

The cygpath binary from Git for Windows has a bug: when the path
contains braces, apostrophes, or certain other special characters, it
strips them out when called from Go, but not from the command line.

This results in us having broken behaviour with those characters in the
current working directory.  To address this, no longer consider MINGW to
be a Cygwin-like environment.
In our shell script tests, we can end up with paths that start with
things like "/tmp", which on Windows is implicitly rewritten into a real
Windows path by the shell.  However, when using the `urlify` function,
that doesn't happen and therefore Git LFS gets a path it cannot handle.

We used to paper over this by calling `cygpath -w` on all the paths we
were given, but the version of `cygpath` shipped with Git for Windows is
subtly broken and we don't want to rely on it anymore, so instead make
our `urlify` helper convert to a canonical native path and then prefix
with a slash if need be.

Similarly, use the `urlify` helper in the multiple remotes test to make
sure that the paths are rewritten properly.
@bk2204 bk2204 marked this pull request as ready for review September 8, 2022 13:40
@bk2204 bk2204 requested a review from a team as a code owner September 8, 2022 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Git LFS not working in folder containing {} Failure to canonicalize path using ASCII apostrophe on Windows

2 participants