MCPcopy Create free account
hub / github.com/libgit2/git2go / AddFetch

Method AddFetch

remote.go:867–882  ·  view source on GitHub ↗
(remote, refspec string)

Source from the content-addressed store, hash-verified

865}
866
867func (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
884func sptr(p uintptr) *C.char {
885 return *(**C.char)(unsafe.Pointer(p))

Callers

nothing calls this directly

Calls 2

MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by

no test coverage detected