(name string, url string, fetch string)
| 723 | } |
| 724 | |
| 725 | func (c *RemoteCollection) CreateWithFetchspec(name string, url string, fetch string) (*Remote, error) { |
| 726 | remote := &Remote{repo: c.repo} |
| 727 | |
| 728 | cname := C.CString(name) |
| 729 | defer C.free(unsafe.Pointer(cname)) |
| 730 | curl := C.CString(url) |
| 731 | defer C.free(unsafe.Pointer(curl)) |
| 732 | cfetch := C.CString(fetch) |
| 733 | defer C.free(unsafe.Pointer(cfetch)) |
| 734 | |
| 735 | runtime.LockOSThread() |
| 736 | defer runtime.UnlockOSThread() |
| 737 | |
| 738 | ret := C.git_remote_create_with_fetchspec(&remote.ptr, c.repo.ptr, cname, curl, cfetch) |
| 739 | if ret < 0 { |
| 740 | return nil, MakeGitError(ret) |
| 741 | } |
| 742 | c.trackRemote(remote) |
| 743 | return remote, nil |
| 744 | } |
| 745 | |
| 746 | func (c *RemoteCollection) CreateAnonymous(url string) (*Remote, error) { |
| 747 | remote := &Remote{repo: c.repo} |
nothing calls this directly
no test coverage detected