-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Test http_auth_offered fails on Windows #4591
Comments
Ah we probably just need to relax the assertion here in the test itself. Should be ok to have a different environment! |
I did some more investigation. It seems that it works correctly if you have |
Hm in theory you shouldn't need git in PATH, although maybe the error is just different if you don't have git in PATH? If so we should just update the test. |
I mean you need The error from cargo if it fails to run the credential helper is: The "success" case (which this test is asserting) is when the credentials are successfully retrieved, but the little pseudo-server listening on localhost returns a You can't just test for the other error message. Not only would that invalidate the test, the test would hang forever because the little pseudo server never receives a connection. I think it's fine for the tests to assume your environment has certain things installed, I just think they need to be documented. I'd be happy to try to document the requirements for running the tests. |
I think in this case we just need to change the assertion to |
No, if you change it to that, it will hang forever, because the server thread never receives a connection. |
Ah ok, well I'm fine with whatever fix works! |
See also upstream issue alexcrichton/git2-rs#274. |
I think this has since been fixed, so closing! |
The test
http_auth_offered
is failing for me on Windows 10 with the following output:The reason this happens is because this code in the git2 package assumes you have a Bourne shell in your path. Even if you have a Bourne shell (such as Git Bash or Cygwin), they often do not support Windows-style paths (in this case, the gitconfig is configured with a path like
helper = H:\\Proj\\rust\\cargo\\target\\cit\\t1\\script\\target\\debug\\script.exe
).Is there something about my environment that should be different? Or does this problem happen for other people? I'm not sure what an appropriate fix would be. The official git client seems to avoid using a shell if there are no shell characters in the command (see prepare_shell_cmd), but even that assumes a backslash implies escaping, so the paths may need to be created in a unix-style.
The text was updated successfully, but these errors were encountered: