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

Method SetPushUrl

remote.go:850–865  ·  view source on GitHub ↗
(remote, url string)

Source from the content-addressed store, hash-verified

848}
849
850func (c *RemoteCollection) SetPushUrl(remote, url string) error {
851 curl := C.CString(url)
852 defer C.free(unsafe.Pointer(curl))
853 cremote := C.CString(remote)
854 defer C.free(unsafe.Pointer(cremote))
855
856 runtime.LockOSThread()
857 defer runtime.UnlockOSThread()
858
859 ret := C.git_remote_set_pushurl(c.repo.ptr, cremote, curl)
860 runtime.KeepAlive(c.repo)
861 if ret < 0 {
862 return MakeGitError(ret)
863 }
864 return nil
865}
866
867func (c *RemoteCollection) AddFetch(remote, refspec string) error {
868 crefspec := C.CString(refspec)

Callers

nothing calls this directly

Calls 2

MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by

no test coverage detected