Returning Problems on Remote Rename

Problems can be returned as string array on RemoteCollection Rename
This commit is contained in:
Mirko Nosenzo 2016-07-07 11:59:37 +02:00
parent 393098522c
commit c6b94a160e
No known key found for this signature in database
GPG Key ID: E6EBC1DB672BD11E
1 changed files with 5 additions and 5 deletions

View File

@ -454,9 +454,9 @@ func (o *Remote) PushUrl() string {
return C.GoString(C.git_remote_pushurl(o.ptr))
}
func (c *RemoteCollection) Rename(remote, newname string) error {
func (c *RemoteCollection) Rename(remote, newname string) ([]string, error) {
cproblems := C.git_strarray{}
defer freeStrarray(&cproblems)
cnewname := C.CString(newname)
defer C.free(unsafe.Pointer(cnewname))
cremote := C.CString(remote)
@ -467,10 +467,10 @@ func (c *RemoteCollection) Rename(remote, newname string) error {
ret := C.git_remote_rename(&cproblems, c.repo.ptr, cremote, cnewname)
if ret < 0 {
return MakeGitError(ret)
problems := makeStringsFromCStrings(cproblems.strings, int(cproblems.count))
return problems, MakeGitError(ret)
}
C.git_strarray_free(&cproblems)
return nil
return []string{}, nil
}
func (c *RemoteCollection) SetUrl(remote, url string) error {