Skip to content

Commit b1cad11

Browse files
authored
FetchOptions: add ability to specify ProxyOptions (libgit2#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.
1 parent 20a55cd commit b1cad11

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
@@ -117,6 +117,9 @@ type FetchOptions struct {
117117

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

122125
type ProxyType uint
@@ -694,6 +697,7 @@ func populateFetchOptions(options *C.git_fetch_options, opts *FetchOptions) {
694697
options.custom_headers = C.git_strarray{}
695698
options.custom_headers.count = C.size_t(len(opts.Headers))
696699
options.custom_headers.strings = makeCStringsFromStrings(opts.Headers)
700+
populateProxyOptions(&options.proxy_opts, &opts.ProxyOptions)
697701
}
698702

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

0 commit comments

Comments
 (0)