diff options
Diffstat (limited to 'wrapper.c')
| -rw-r--r-- | wrapper.c | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -1,5 +1,7 @@ #include "_cgo_export.h" #include "git2.h" +#include "git2/sys/odb_backend.h" +#include "git2/sys/refdb_backend.h" #include "git2/submodule.h" #include "git2/pack.h" @@ -25,6 +27,22 @@ int _go_git_odb_foreach(git_odb *db, void *payload) return git_odb_foreach(db, (git_odb_foreach_cb)&odbForEachCb, payload); } +void _go_git_odb_backend_free(git_odb_backend *backend) +{ + if (backend->free) + backend->free(backend); + + return; +} + +void _go_git_refdb_backend_free(git_refdb_backend *backend) +{ + if (backend->free) + backend->free(backend); + + return; +} + int _go_git_diff_foreach(git_diff *diff, int eachFile, int eachHunk, int eachLine, void *payload) { git_diff_file_cb fcb = NULL; @@ -51,12 +69,11 @@ void _go_git_setup_diff_notify_callbacks(git_diff_options *opts) { } void _go_git_setup_callbacks(git_remote_callbacks *callbacks) { - typedef int (*progress_cb)(const char *str, int len, 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 (*transfer_progress_cb)(const git_transfer_progress *stats, void *data); typedef int (*update_tips_cb)(const char *refname, const git_oid *a, const git_oid *b, void *data); - callbacks->progress = (progress_cb)progressCallback; + callbacks->sideband_progress = (git_transport_message_cb)sidebandProgressCallback; callbacks->completion = (completion_cb)completionCallback; callbacks->credentials = (credentials_cb)credentialsCallback; callbacks->transfer_progress = (transfer_progress_cb)transferProgressCallback; @@ -87,4 +104,5 @@ int _go_git_blob_create_fromchunks(git_oid *id, { return git_blob_create_fromchunks(id, repo, hintpath, _go_blob_chunk_cb, payload); } + /* EOF */ |
