Unverified Commit c8823fb0 by Laurence McGlashan Committed by GitHub

Apply suggestions from code review

Co-authored-by: Edward Thomson <ethomson@github.com>
parent e994299f
......@@ -888,19 +888,16 @@ static int http_proxy_config(char **out, git_remote *remote, git_net_url *url)
git_buf buf = GIT_BUF_INIT;
git_net_url lookup_url = GIT_NET_URL_INIT;
int error;
int cleanup_config = 0;
if ((error = git_net_url_dup(&lookup_url, url)) < 0)
goto done;
if (remote->repo) {
if ((error = git_repository_config__weakptr(&cfg, remote->repo)) < 0)
if ((error = git_repository_config(&cfg, remote->repo)) < 0)
goto done;
} else {
if ((error = git_config_open_default(&cfg)) < 0)
goto done;
cleanup_config = 1;
}
/* remote.<name>.proxy config setting */
......@@ -932,9 +929,7 @@ static int http_proxy_config(char **out, git_remote *remote, git_net_url *url)
error = lookup_config(out, cfg, "http.proxy");
done:
if (cleanup_config)
git_config_free(cfg);
git_config_free(cfg);
git_buf_dispose(&buf);
git_net_url_dispose(&lookup_url);
return error;
......
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