(remote, refspec string)
| 865 | } |
| 866 | |
| 867 | func (c *RemoteCollection) AddFetch(remote, refspec string) error { |
| 868 | crefspec := C.CString(refspec) |
| 869 | defer C.free(unsafe.Pointer(crefspec)) |
| 870 | cremote := C.CString(remote) |
| 871 | defer C.free(unsafe.Pointer(cremote)) |
| 872 | |
| 873 | runtime.LockOSThread() |
| 874 | defer runtime.UnlockOSThread() |
| 875 | |
| 876 | ret := C.git_remote_add_fetch(c.repo.ptr, cremote, crefspec) |
| 877 | runtime.KeepAlive(c.repo) |
| 878 | if ret < 0 { |
| 879 | return MakeGitError(ret) |
| 880 | } |
| 881 | return nil |
| 882 | } |
| 883 | |
| 884 | func sptr(p uintptr) *C.char { |
| 885 | return *(**C.char)(unsafe.Pointer(p)) |
nothing calls this directly
no test coverage detected