Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to uniformly handle Windows-style paths. #549

Merged
merged 1 commit into from
Apr 13, 2020

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Apr 13, 2020

Passing a Windows path with backslashes to a git2 API that expects a repo path is always wrong. This attempts to consolidate the translation of backslashes, and I tried to cover every method that takes a repo path or pathspec.

This also checks if the path is absolute on all platforms. git2 repo paths are never absolute (AFAIK). The intent is to avoid footguns like #164 where passing filesystem-like paths with leading non-normal components never works (except for maybe is_path_ignored).

I flip-flopped a lot on how to approach this, and I'm not entirely happy with it (though I can't pinpoint why). I generally wanted to avoid changing any public APIs.

Closes #340

@alexcrichton
Copy link
Member

👍

Seems reasonable to me!

@alexcrichton alexcrichton merged commit cf91e4c into rust-lang:master Apr 13, 2020
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.

more path not working on windows
2 participants