clone: don't decode URL percent encodings#5187
Conversation
|
Yeah, this seems right to me. Looks like this got introduced in #4563, but I agree that we should round-trip path unaltered. The test is a bit tricky, though. We probably should have a repo for the project in a hosting provider that allows spaces in URLs (which I think is only Azure Repos), so that we're not reliant on your test project. I can set that up (we already have |
Yep, my test repo was definitely intended to be temporary while I was debugging the issue. I also noticed we're decoding host, query, and user/pass in Looking at #4563, it looks like there were some issues with SSH and encoding/decoding previously. I can clone correctly via SSH with this fix in place, however just wanted to bring that up. |
|
@ianhattendorf I set up https://libgit2@dev.azure.com/libgit2/test/_git/spaces%20in%20the%20name which is a mirror of the existing test repo (https://github.com/libgit2/TestGitRepository), would you mind pointing this test there? Thanks! |
|
@ethomson Sure, I've updated the tests. Would it be possible to get SSH working on the Also, I'm confused why it's only failing on Linux. Did I miss a step in adding an online ssh test that resulted in it being skipped on macOS/Windows? |
Hmm, in a perfect world, we would do this indeed. But that would mean setting up an SSH public key in an actual user account in Azure DevOps. Even if that user was set to read-only for repositories, I'm a little bit loathe to set that up without thinking through it more deeply. Can you just update this branch to include the HTTP tests, and then open a new pull request for the SSH changes? That way we can merge this 🔜 to fix the bug, and then we can revisit the SSH test for completeness as time allows?
I don't think that we build with libssh2 support on those platforms. |
Will add later when infrastructure is configured
|
Sounds good, I've removed the ssh test and I'll open a PR later to add it back in. |
|
Nice one, thanks for the fix! |
Test fails on at least macOS and Linux with
error -1 - unexpected HTTP status code: 400. libgit2 attempts to clonehttps://dev.azure.com/ianhattendorf/With Space/_git/With Space, due togit_net_url_parsesetting URL path withgit_buf_decode_percent.