(refspecs []string, opts *PushOptions)
| 1165 | } |
| 1166 | |
| 1167 | func (o *Remote) Push(refspecs []string, opts *PushOptions) error { |
| 1168 | crefspecs := C.git_strarray{ |
| 1169 | count: C.size_t(len(refspecs)), |
| 1170 | strings: makeCStringsFromStrings(refspecs), |
| 1171 | } |
| 1172 | defer freeStrarray(&crefspecs) |
| 1173 | |
| 1174 | var err error |
| 1175 | coptions := populatePushOptions(&C.git_push_options{}, opts, &err) |
| 1176 | defer freePushOptions(coptions) |
| 1177 | |
| 1178 | runtime.LockOSThread() |
| 1179 | defer runtime.UnlockOSThread() |
| 1180 | |
| 1181 | ret := C.git_remote_push(o.ptr, &crefspecs, coptions) |
| 1182 | runtime.KeepAlive(o) |
| 1183 | if ret == C.int(ErrorCodeUser) && err != nil { |
| 1184 | return err |
| 1185 | } |
| 1186 | if ret < 0 { |
| 1187 | return MakeGitError(ret) |
| 1188 | } |
| 1189 | return nil |
| 1190 | } |
| 1191 | |
| 1192 | func (o *Remote) PruneRefs() bool { |
| 1193 | return C.git_remote_prune_refs(o.ptr) > 0 |
nothing calls this directly
no test coverage detected