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

Method Lookup

remote.go:763–778  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

761}
762
763func (c *RemoteCollection) Lookup(name string) (*Remote, error) {
764 remote := &Remote{repo: c.repo}
765
766 cname := C.CString(name)
767 defer C.free(unsafe.Pointer(cname))
768
769 runtime.LockOSThread()
770 defer runtime.UnlockOSThread()
771
772 ret := C.git_remote_lookup(&remote.ptr, c.repo.ptr, cname)
773 if ret < 0 {
774 return nil, MakeGitError(ret)
775 }
776 c.trackRemote(remote)
777 return remote, nil
778}
779
780func (c *RemoteCollection) Free() {
781 var remotes []*Remote

Callers

nothing calls this directly

Calls 3

trackRemoteMethod · 0.95
MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by

no test coverage detected