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

Method CreateWithOptions

remote.go:689–708  ·  view source on GitHub ↗

CreateWithOptions Creates a repository object with extended options.

(url string, option *RemoteCreateOptions)

Source from the content-addressed store, hash-verified

687
688//CreateWithOptions Creates a repository object with extended options.
689func (c *RemoteCollection) CreateWithOptions(url string, option *RemoteCreateOptions) (*Remote, error) {
690 remote := &Remote{repo: c.repo}
691
692 curl := C.CString(url)
693 defer C.free(unsafe.Pointer(curl))
694
695 runtime.LockOSThread()
696 defer runtime.UnlockOSThread()
697
698 copts := populateRemoteCreateOptions(&C.git_remote_create_options{}, option, c.repo)
699 defer freeRemoteCreateOptions(copts)
700
701 ret := C.git_remote_create_with_opts(&remote.ptr, curl, copts)
702 runtime.KeepAlive(c.repo)
703 if ret < 0 {
704 return nil, MakeGitError(ret)
705 }
706 c.trackRemote(remote)
707 return remote, nil
708}
709
710func (c *RemoteCollection) Delete(name string) error {
711 cname := C.CString(name)

Callers 1

TestRemoteConnectOptionFunction · 0.80

Calls 5

trackRemoteMethod · 0.95
freeRemoteCreateOptionsFunction · 0.85
MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by 1

TestRemoteConnectOptionFunction · 0.64