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:
parent
805085c1d7
commit
d805ba7409
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue