minor
This commit is contained in:
parent
5d8a14d108
commit
d124544668
12
remote.go
12
remote.go
|
@ -4,12 +4,8 @@ package git
|
||||||
#include <git2.h>
|
#include <git2.h>
|
||||||
#include <git2/errors.h>
|
#include <git2/errors.h>
|
||||||
|
|
||||||
static git_remote_callbacks git_remote_callbacks_init() {
|
extern void _go_git_setup_callbacks(git_remote_callbacks *callbacks);
|
||||||
git_remote_callbacks ret = GIT_REMOTE_CALLBACKS_INIT;
|
extern git_remote_callbacks _go_git_remote_callbacks_init();
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern void _setup_callbacks(git_remote_callbacks *callbacks);
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
|
@ -41,11 +37,11 @@ type RemoteCallbacks struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func populateRemoteCallbacks(ptr *C.git_remote_callbacks, callbacks *RemoteCallbacks) {
|
func populateRemoteCallbacks(ptr *C.git_remote_callbacks, callbacks *RemoteCallbacks) {
|
||||||
*ptr = C.git_remote_callbacks_init()
|
*ptr = C._go_git_remote_callbacks_init()
|
||||||
if callbacks == nil {
|
if callbacks == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
C._setup_callbacks(ptr)
|
C._go_git_setup_callbacks(ptr)
|
||||||
ptr.payload = unsafe.Pointer(callbacks)
|
ptr.payload = unsafe.Pointer(callbacks)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ int _go_git_odb_foreach(git_odb *db, void *payload)
|
||||||
return git_odb_foreach(db, (git_odb_foreach_cb)&odbForEachCb, payload);
|
return git_odb_foreach(db, (git_odb_foreach_cb)&odbForEachCb, payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _setup_callbacks(git_remote_callbacks *callbacks) {
|
void _go_git_setup_callbacks(git_remote_callbacks *callbacks) {
|
||||||
typedef int (*progress_cb)(const char *str, int len, void *data);
|
typedef int (*progress_cb)(const char *str, int len, void *data);
|
||||||
typedef int (*completion_cb)(git_remote_completion_type type, void *data);
|
typedef int (*completion_cb)(git_remote_completion_type type, void *data);
|
||||||
typedef int (*credentials_cb)(git_cred **cred, const char *url, const char *username_from_url, unsigned int allowed_types, void *data);
|
typedef int (*credentials_cb)(git_cred **cred, const char *url, const char *username_from_url, unsigned int allowed_types, void *data);
|
||||||
|
@ -38,4 +38,9 @@ void _setup_callbacks(git_remote_callbacks *callbacks) {
|
||||||
callbacks->update_tips = (update_tips_cb)updateTipsCallback;
|
callbacks->update_tips = (update_tips_cb)updateTipsCallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
git_remote_callbacks _go_git_remote_callbacks_init() {
|
||||||
|
git_remote_callbacks ret = GIT_REMOTE_CALLBACKS_INIT;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Reference in New Issue