diff options
| author | Mirko Nosenzo <[email protected]> | 2016-07-07 11:59:37 +0200 |
|---|---|---|
| committer | Mirko Nosenzo <[email protected]> | 2016-07-07 12:01:24 +0200 |
| commit | c6b94a160eef7546fa61e9e06f50f272d68bab8c (patch) | |
| tree | afc085d0f09cc75512b544c80daffd0b249c053c | |
| parent | 393098522c3f01b1cd765581c4d4e6d43f3a02d0 (diff) | |
Returning Problems on Remote Rename
Problems can be returned as string array on RemoteCollection Rename
| -rw-r--r-- | remote.go | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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 { |
