Unverified Commit 0f40e68e by Edward Thomson Committed by GitHub

Merge pull request #5187 from ianhattendorf/fix/clone-whitespace

clone: don't decode URL percent encodings
parents 08cfa43d 62b80138
......@@ -94,7 +94,7 @@ int git_net_url_parse(git_net_url *url, const char *given)
if (has_path) {
const char *url_path = given + u.field_data[UF_PATH].off;
size_t url_path_len = u.field_data[UF_PATH].len;
git_buf_decode_percent(&path, url_path, url_path_len);
git_buf_put(&path, url_path, url_path_len);
} else {
git_buf_puts(&path, "/");
}
......
......@@ -69,5 +69,5 @@ ADD_CLAR_TEST(offline -v -xonline)
ADD_CLAR_TEST(invasive -v -score::ftruncate -sfilter::stream::bigfile -sodb::largefiles -siterator::workdir::filesystem_gunk -srepo::init -srepo::init::at_filesystem_root)
ADD_CLAR_TEST(online -v -sonline)
ADD_CLAR_TEST(gitdaemon -v -sonline::push)
ADD_CLAR_TEST(ssh -v -sonline::push -sonline::clone::ssh_cert -sonline::clone::ssh_with_paths)
ADD_CLAR_TEST(ssh -v -sonline::push -sonline::clone::ssh_cert -sonline::clone::ssh_with_paths -sonline::clone::path_whitespace_ssh)
ADD_CLAR_TEST(proxy -v -sonline::clone::proxy)
......@@ -863,3 +863,9 @@ void test_online_clone__proxy_cred_callback_after_failed_url_creds(void)
git_buf_dispose(&url);
}
void test_online_clone__path_whitespace(void)
{
cl_git_pass(git_clone(&g_repo, "https://libgit2@dev.azure.com/libgit2/test/_git/spaces%20in%20the%20name", "./foo", &g_options));
cl_assert(git_path_exists("./foo/master.txt"));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment