Skip to content

Commit 2db870d

Browse files
lollipopmanlhchavez
authored andcommitted
FetchOptions: add ability to specify ProxyOptions (#623)
Prior to this change you could not specifiy proxy options on the FetchOptions struct, which made it impossible to specify a proxy for an initial clone. This change adds the ProxyOptions to the FetchOptions struct so you can go through a proxy when cloning. (cherry picked from commit b1cad11)
1 parent fb3bfdb commit 2db870d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

remote.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ type FetchOptions struct {
116116

117117
// Headers are extra headers for the fetch operation.
118118
Headers []string
119+
120+
// Proxy options to use for this fetch operation
121+
ProxyOptions ProxyOptions
119122
}
120123

121124
type ProxyType uint
@@ -687,6 +690,7 @@ func populateFetchOptions(options *C.git_fetch_options, opts *FetchOptions) {
687690
options.custom_headers = C.git_strarray{}
688691
options.custom_headers.count = C.size_t(len(opts.Headers))
689692
options.custom_headers.strings = makeCStringsFromStrings(opts.Headers)
693+
populateProxyOptions(&options.proxy_opts, &opts.ProxyOptions)
690694
}
691695

692696
func populatePushOptions(options *C.git_push_options, opts *PushOptions) {

0 commit comments

Comments
 (0)