summaryrefslogtreecommitdiff
path: root/wrapper.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2015-06-12 19:10:00 +0200
committerCarlos Martín Nieto <[email protected]>2015-06-29 21:29:47 +0200
commite066d24efba9587a66cf9eb6221b4a38c513c26e (patch)
tree9ec58d873894ce447a2f6ba1bcf4c18c4bb16207 /wrapper.c
parent86e9917919afd0f71340c0a2ebc8ee28f2030790 (diff)
Add DiffBlobs
This lets you diff two arbitrary blobs with arbitrary names.
Diffstat (limited to 'wrapper.c')
-rw-r--r--wrapper.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/wrapper.c b/wrapper.c
index 938fd17..017168d 100644
--- a/wrapper.c
+++ b/wrapper.c
@@ -62,6 +62,27 @@ int _go_git_diff_foreach(git_diff *diff, int eachFile, int eachHunk, int eachLin
return git_diff_foreach(diff, fcb, hcb, lcb, payload);
}
+int _go_git_diff_blobs(git_blob *old, const char *old_path, git_blob *new, const char *new_path, git_diff_options *opts, 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_blobs(old, old_path, new, new_path, opts, fcb, hcb, lcb, payload);
+}
+
void _go_git_setup_diff_notify_callbacks(git_diff_options *opts) {
opts->notify_cb = (git_diff_notify_cb)diffNotifyCb;
}