From ddd4cc725d7389b3b49744b19241e19fd7e7210f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien?= <6292584+au2001@users.noreply.github.com> Date: Tue, 18 Jan 2022 04:02:14 +0100 Subject: [PATCH] Add ProxyOptions for push operations (#872) Analog to #623 but for push operations rather than fetch. (cherry picked from commit 5eca48cda937e67c1f8d68a55c2db22a79d83d0c) --- remote.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/remote.go b/remote.go index b9076833..b95b441c 100644 --- a/remote.go +++ b/remote.go @@ -291,6 +291,9 @@ type PushOptions struct { // Headers are extra headers for the push operation. Headers []string + + // Proxy options to use for this push operation + ProxyOptions ProxyOptions } type RemoteHead struct { @@ -991,6 +994,7 @@ func populatePushOptions(copts *C.git_push_options, opts *PushOptions, errorTarg strings: makeCStringsFromStrings(opts.Headers), } populateRemoteCallbacks(&copts.callbacks, &opts.RemoteCallbacks, errorTarget) + populateProxyOptions(&copts.proxy_opts, &opts.ProxyOptions) return copts } @@ -1000,6 +1004,7 @@ func freePushOptions(copts *C.git_push_options) { } untrackCallbacksPayload(&copts.callbacks) freeStrarray(&copts.custom_headers) + freeProxyOptions(&copts.proxy_opts) } // Fetch performs a fetch operation. refspecs specifies which refspecs