| 744 | } |
| 745 | |
| 746 | func (c *RemoteCollection) CreateAnonymous(url string) (*Remote, error) { |
| 747 | remote := &Remote{repo: c.repo} |
| 748 | |
| 749 | curl := C.CString(url) |
| 750 | defer C.free(unsafe.Pointer(curl)) |
| 751 | |
| 752 | runtime.LockOSThread() |
| 753 | defer runtime.UnlockOSThread() |
| 754 | |
| 755 | ret := C.git_remote_create_anonymous(&remote.ptr, c.repo.ptr, curl) |
| 756 | if ret < 0 { |
| 757 | return nil, MakeGitError(ret) |
| 758 | } |
| 759 | c.trackRemote(remote) |
| 760 | return remote, nil |
| 761 | } |
| 762 | |
| 763 | func (c *RemoteCollection) Lookup(name string) (*Remote, error) { |
| 764 | remote := &Remote{repo: c.repo} |