Remote: incorporate callbacks into the struct

Let a user with a Remote object use it, same as it's wired up for clone.
This commit is contained in:
Carlos Martín Nieto 2014-03-21 07:20:41 +01:00
parent 805085c1d7
commit d805ba7409
1 changed files with 5 additions and 0 deletions

View File

@ -55,6 +55,8 @@ type RemoteCallbacks struct {
type Remote struct {
ptr *C.git_remote
repo *Repository
Callbacks RemoteCallbacks
}
func newRemote(cremote *C.git_remote, repo *Repository) *Remote {
@ -63,6 +65,9 @@ func newRemote(cremote *C.git_remote, repo *Repository) *Remote {
repo: repo,
}
var callbacks C.git_remote_callbacks
populateRemoteCallbacks(&callbacks, &remote.Callbacks)
runtime.SetFinalizer(remote, (*Remote).Free)
return remote
}