Skip to content

Commit

Permalink
Add ProxyOptions for push operations (#872) (#884)
Browse files Browse the repository at this point in the history
Analog to #623 but for push operations rather than fetch.

(cherry picked from commit 5eca48c)

Co-authored-by: Aurélien <6292584+au2001@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and au2001 authored Jan 18, 2022
1 parent b1120d3 commit a800947
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}

Expand All @@ -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
Expand Down

0 comments on commit a800947

Please sign in to comment.