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

Method List

remote.go:652–667  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

650}
651
652func (c *RemoteCollection) List() ([]string, error) {
653 var r C.git_strarray
654
655 runtime.LockOSThread()
656 defer runtime.UnlockOSThread()
657
658 ecode := C.git_remote_list(&r, c.repo.ptr)
659 runtime.KeepAlive(c.repo)
660 if ecode < 0 {
661 return nil, MakeGitError(ecode)
662 }
663 defer C.git_strarray_dispose(&r)
664
665 remotes := makeStringsFromCStrings(r.strings, int(r.count))
666 return remotes, nil
667}
668
669func (c *RemoteCollection) Create(name string, url string) (*Remote, error) {
670 remote := &Remote{repo: c.repo}

Callers

nothing calls this directly

Calls 2

MakeGitErrorFunction · 0.85
makeStringsFromCStringsFunction · 0.85

Tested by

no test coverage detected