diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-01-24 16:59:41 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-02-24 12:14:20 +0100 |
commit | 8c5a7b8dc317307f494a83a8d985f5c5ee09a3a4 (patch) | |
tree | 214486b1f9b57bf3d81758fcce24c8ea5eedd319 /etc/patches/libgit2_v1.2.0_fix-proxy-settings.patch | |
parent | b86388107fda2094060a5e9470728b7be9d750c9 (diff) | |
download | justbuild-8c5a7b8dc317307f494a83a8d985f5c5ee09a3a4.tar.gz |
libgit2: Update to v1.5.0
Changes to build description:
- new USE_SHA256 flag
- removed "Generic" option for USE_SHA1
- updated to the new source code structure
(split "src/git2" into "src/libgit2" and "src/util")
Diffstat (limited to 'etc/patches/libgit2_v1.2.0_fix-proxy-settings.patch')
-rw-r--r-- | etc/patches/libgit2_v1.2.0_fix-proxy-settings.patch | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/etc/patches/libgit2_v1.2.0_fix-proxy-settings.patch b/etc/patches/libgit2_v1.2.0_fix-proxy-settings.patch deleted file mode 100644 index 775ba392..00000000 --- a/etc/patches/libgit2_v1.2.0_fix-proxy-settings.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 9488139554c486fd0691d4b90fb6aff479c0421d Mon Sep 17 00:00:00 2001 -From: Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> -Date: Mon, 23 Jan 2023 17:19:02 +0100 -Subject: [PATCH] Correct handling of no_proxy .gitconfig options to match git - behavior - -Explicitly removing the need for a proxy for specific remotes in the -.gitconfig file via -~~~ -[http <URL>] - proxy = -~~~ -results in an `error code 12: malformed URL ''` error. Expected -behavior is to treat remotes for which such .gitconfig entries exist -the same as if no proxy settings have been found at all. - -This issue was found in libgit2 v1.2.0. - -This commit fixes the issue. ---- - src/remote.c | 18 ++++++++++++++++-- - 1 file changed, 16 insertions(+), 2 deletions(-) - -diff --git a/src/remote.c b/src/remote.c -index 7dddea93a..6021c27d4 100644 ---- a/src/remote.c -+++ b/src/remote.c -@@ -887,6 +887,7 @@ static int http_proxy_config(char **out, git_remote *remote, git_net_url *url) - git_config *cfg; - git_buf buf = GIT_BUF_INIT; - git_net_url lookup_url = GIT_NET_URL_INIT; -+ char *tmp_out = NULL; - int error; - - if ((error = git_net_url_dup(&lookup_url, url)) < 0 || -@@ -898,8 +899,14 @@ static int http_proxy_config(char **out, git_remote *remote, git_net_url *url) - git_buf_clear(&buf); - - if ((error = git_buf_printf(&buf, "remote.%s.proxy", remote->name)) < 0 || -- (error = lookup_config(out, cfg, buf.ptr)) != GIT_ENOTFOUND) -+ (error = lookup_config(&tmp_out, cfg, buf.ptr)) != GIT_ENOTFOUND) { -+ /* only non-empty entries should be passed as proxy url */ -+ if (!tmp_out || strcmp(tmp_out, "")) { -+ *out = git__strdup(tmp_out); -+ GIT_ERROR_CHECK_ALLOC(*out); -+ } - goto done; -+ } - } - - while (true) { -@@ -908,8 +915,14 @@ static int http_proxy_config(char **out, git_remote *remote, git_net_url *url) - if ((error = git_buf_puts(&buf, "http.")) < 0 || - (error = git_net_url_fmt(&buf, &lookup_url)) < 0 || - (error = git_buf_puts(&buf, ".proxy")) < 0 || -- (error = lookup_config(out, cfg, buf.ptr)) != GIT_ENOTFOUND) -+ (error = lookup_config(&tmp_out, cfg, buf.ptr)) != GIT_ENOTFOUND) { -+ /* only non-empty entries should be passed as proxy url */ -+ if (!tmp_out || strcmp(tmp_out, "")) { -+ *out = git__strdup(tmp_out); -+ GIT_ERROR_CHECK_ALLOC(*out); -+ } - goto done; -+ } - - if (! lookup_url.path[0]) - break; -@@ -924,6 +937,7 @@ static int http_proxy_config(char **out, git_remote *remote, git_net_url *url) - done: - git_buf_dispose(&buf); - git_net_url_dispose(&lookup_url); -+ git__free(tmp_out); - return error; - } - --- -2.30.2 - |