(copts *C.git_clone_options, opts *CloneOptions, errorTarget *error)
| 96 | } |
| 97 | |
| 98 | func populateCloneOptions(copts *C.git_clone_options, opts *CloneOptions, errorTarget *error) *C.git_clone_options { |
| 99 | C.git_clone_options_init(copts, C.GIT_CLONE_OPTIONS_VERSION) |
| 100 | if opts == nil { |
| 101 | return nil |
| 102 | } |
| 103 | populateCheckoutOptions(&copts.checkout_opts, &opts.CheckoutOptions, errorTarget) |
| 104 | populateFetchOptions(&copts.fetch_opts, &opts.FetchOptions, errorTarget) |
| 105 | copts.bare = cbool(opts.Bare) |
| 106 | |
| 107 | if opts.RemoteCreateCallback != nil { |
| 108 | data := &cloneCallbackData{ |
| 109 | options: opts, |
| 110 | errorTarget: errorTarget, |
| 111 | } |
| 112 | // Go v1.1 does not allow to assign a C function pointer |
| 113 | C._go_git_populate_clone_callbacks(copts) |
| 114 | copts.remote_cb_payload = pointerHandles.Track(data) |
| 115 | } |
| 116 | |
| 117 | return copts |
| 118 | } |
| 119 | |
| 120 | func freeCloneOptions(copts *C.git_clone_options) { |
| 121 | if copts == nil { |
no test coverage detected
searching dependent graphs…