Skip to content

Commit c8823fb

Browse files
lrm29Edward Thomson
andauthored
Apply suggestions from code review
Co-authored-by: Edward Thomson <ethomson@github.com>
1 parent e994299 commit c8823fb

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/remote.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -888,19 +888,16 @@ static int http_proxy_config(char **out, git_remote *remote, git_net_url *url)
888888
git_buf buf = GIT_BUF_INIT;
889889
git_net_url lookup_url = GIT_NET_URL_INIT;
890890
int error;
891-
int cleanup_config = 0;
892891

893892
if ((error = git_net_url_dup(&lookup_url, url)) < 0)
894893
goto done;
895894

896895
if (remote->repo) {
897-
if ((error = git_repository_config__weakptr(&cfg, remote->repo)) < 0)
896+
if ((error = git_repository_config(&cfg, remote->repo)) < 0)
898897
goto done;
899898
} else {
900899
if ((error = git_config_open_default(&cfg)) < 0)
901900
goto done;
902-
903-
cleanup_config = 1;
904901
}
905902

906903
/* remote.<name>.proxy config setting */
@@ -932,9 +929,7 @@ static int http_proxy_config(char **out, git_remote *remote, git_net_url *url)
932929
error = lookup_config(out, cfg, "http.proxy");
933930

934931
done:
935-
if (cleanup_config)
936-
git_config_free(cfg);
937-
932+
git_config_free(cfg);
938933
git_buf_dispose(&buf);
939934
git_net_url_dispose(&lookup_url);
940935
return error;

0 commit comments

Comments
 (0)