Commit 35d86c77 by Jason Haslam

proxy: fix crash on remote connection with GIT_PROXY_AUTO but no proxy is detected

parent 1305cd4e
......@@ -679,6 +679,9 @@ static int load_proxy_config(http_subtransport *t)
!!t->server.url.use_ssl, &t->proxy_url)) < 0)
return error;
if (!t->proxy_url)
return 0;
t->proxy_opts.type = GIT_PROXY_SPECIFIED;
t->proxy_opts.url = t->proxy_url;
t->proxy_opts.credentials = t->owner->proxy.credentials;
......
......@@ -840,3 +840,10 @@ void test_online_clone__proxy_credentials_in_environment(void)
git_buf_dispose(&url);
}
void test_online_clone__proxy_auto_not_detected(void)
{
g_options.fetch_opts.proxy_opts.type = GIT_PROXY_AUTO;
cl_git_pass(git_clone(&g_repo, "http://github.com/libgit2/TestGitRepository", "./foo", &g_options));
}
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