mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Cloud storage: delete http.proxy key if no proxy is set
Apparently Windows doesn't like it if the proxy string is set to the empty string. Also give some better debugging output when run in verbose mode. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
c4eb9571be
commit
aa76f74f97
1 changed files with 13 additions and 3 deletions
16
git-access.c
16
git-access.c
|
@ -507,10 +507,14 @@ int sync_with_remote(git_repository *repo, const char *remote, const char *branc
|
|||
|
||||
git_repository_config(&conf, repo);
|
||||
if (rt == RT_HTTPS && getProxyString(&proxy_string)) {
|
||||
if (verbose)
|
||||
fprintf(stderr, "set proxy to \"%s\"\n", proxy_string);
|
||||
git_config_set_string(conf, "http.proxy", proxy_string);
|
||||
free(proxy_string);
|
||||
} else {
|
||||
git_config_set_string(conf, "http.proxy", "");
|
||||
if (verbose)
|
||||
fprintf(stderr, "delete proxy setting\n");
|
||||
git_config_delete_entry(conf, "http.proxy");
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -550,7 +554,7 @@ int sync_with_remote(git_repository *repo, const char *remote, const char *branc
|
|||
else
|
||||
report_error("Unable to fetch remote '%s'", remote);
|
||||
if (verbose)
|
||||
fprintf(stderr, "remote fetched failed (%s)\n", giterr_last()->message);
|
||||
fprintf(stderr, "remote fetch failed (%s)\n", giterr_last()->message);
|
||||
error = 0;
|
||||
} else {
|
||||
error = check_remote_status(repo, origin, remote, branch, rt);
|
||||
|
@ -586,10 +590,16 @@ static int repository_create_cb(git_repository **out, const char *path, int bare
|
|||
|
||||
int ret = git_repository_init(out, path, bare);
|
||||
|
||||
if (getProxyString(&proxy_string)) {
|
||||
git_repository_config(&conf, *out);
|
||||
if (getProxyString(&proxy_string)) {
|
||||
if (verbose)
|
||||
fprintf(stderr, "set proxy to \"%s\"\n", proxy_string);
|
||||
git_config_set_string(conf, "http.proxy", proxy_string);
|
||||
free(proxy_string);
|
||||
} else {
|
||||
if (verbose)
|
||||
fprintf(stderr, "delete proxy setting\n");
|
||||
git_config_delete_entry(conf, "http.proxy");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue