(name string, url string)
| 667 | } |
| 668 | |
| 669 | func (c *RemoteCollection) Create(name string, url string) (*Remote, error) { |
| 670 | remote := &Remote{repo: c.repo} |
| 671 | |
| 672 | cname := C.CString(name) |
| 673 | defer C.free(unsafe.Pointer(cname)) |
| 674 | curl := C.CString(url) |
| 675 | defer C.free(unsafe.Pointer(curl)) |
| 676 | |
| 677 | runtime.LockOSThread() |
| 678 | defer runtime.UnlockOSThread() |
| 679 | |
| 680 | ret := C.git_remote_create(&remote.ptr, c.repo.ptr, cname, curl) |
| 681 | if ret < 0 { |
| 682 | return nil, MakeGitError(ret) |
| 683 | } |
| 684 | c.trackRemote(remote) |
| 685 | return remote, nil |
| 686 | } |
| 687 | |
| 688 | //CreateWithOptions Creates a repository object with extended options. |
| 689 | func (c *RemoteCollection) CreateWithOptions(url string, option *RemoteCreateOptions) (*Remote, error) { |
nothing calls this directly
no test coverage detected