summaryrefslogtreecommitdiff
path: root/wrapper.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2014-04-26 20:51:21 +0200
committerCarlos Martín Nieto <[email protected]>2014-04-26 20:51:21 +0200
commit5809f031087e5665549de3355034b193f7c13853 (patch)
treef6b673a2893649b95ea7d157db0e4b43ce9e0e19 /wrapper.c
parent4df7eb516c7c73f82a62a8bdb2ac33f2b73ab981 (diff)
parent63fd1f9b032c92b330948cd66dfa0b677d982d03 (diff)
Merge commit 'refs/pull/72/head' of github.com:libgit2/git2go
Conflicts: git.go wrapper.c
Diffstat (limited to 'wrapper.c')
-rw-r--r--wrapper.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/wrapper.c b/wrapper.c
index b0ca5e5..2fd8fb7 100644
--- a/wrapper.c
+++ b/wrapper.c
@@ -43,6 +43,31 @@ void _go_git_refdb_backend_free(git_refdb_backend *backend)
return;
}
+int _go_git_diff_foreach(git_diff *diff, int eachFile, int eachHunk, int eachLine, void *payload)
+{
+ git_diff_file_cb fcb = NULL;
+ git_diff_hunk_cb hcb = NULL;
+ git_diff_line_cb lcb = NULL;
+
+ if (eachFile) {
+ fcb = (git_diff_file_cb)&diffForEachFileCb;
+ }
+
+ if (eachHunk) {
+ hcb = (git_diff_hunk_cb)&diffForEachHunkCb;
+ }
+
+ if (eachLine) {
+ lcb = (git_diff_line_cb)&diffForEachLineCb;
+ }
+
+ return git_diff_foreach(diff, fcb, hcb, lcb, payload);
+}
+
+void _go_git_setup_diff_notify_callbacks(git_diff_options *opts) {
+ opts->notify_cb = (git_diff_notify_cb)diffNotifyCb;
+}
+
void _go_git_setup_callbacks(git_remote_callbacks *callbacks) {
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);