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

Method Rename

remote.go:812–831  ·  view source on GitHub ↗
(remote, newname string)

Source from the content-addressed store, hash-verified

810}
811
812func (c *RemoteCollection) Rename(remote, newname string) ([]string, error) {
813 cproblems := C.git_strarray{}
814 defer freeStrarray(&cproblems)
815 cnewname := C.CString(newname)
816 defer C.free(unsafe.Pointer(cnewname))
817 cremote := C.CString(remote)
818 defer C.free(unsafe.Pointer(cremote))
819
820 runtime.LockOSThread()
821 defer runtime.UnlockOSThread()
822
823 ret := C.git_remote_rename(&cproblems, c.repo.ptr, cremote, cnewname)
824 runtime.KeepAlive(c.repo)
825 if ret < 0 {
826 return []string{}, MakeGitError(ret)
827 }
828
829 problems := makeStringsFromCStrings(cproblems.strings, int(cproblems.count))
830 return problems, nil
831}
832
833func (c *RemoteCollection) SetUrl(remote, url string) error {
834 curl := C.CString(url)

Callers

nothing calls this directly

Calls 4

freeStrarrayFunction · 0.85
MakeGitErrorFunction · 0.85
makeStringsFromCStringsFunction · 0.85
freeMethod · 0.80

Tested by

no test coverage detected