Lines 1-38
Link Here
|
1 |
commit 37aa25a1a4508c3d7559c0a2d00663b9c8d322c6 |
|
|
2 |
Author: Colomban Wendling <ban@herbesfolles.org> |
3 |
Date: Thu Sep 10 14:29:14 2015 +0200 |
4 |
|
5 |
git-changebar: Add support for libgit2 >= 0.23 |
6 |
|
7 |
Closes #283. |
8 |
|
9 |
diff --git git-changebar/src/gcb-plugin.c git-changebar/src/gcb-plugin.c |
10 |
index 81393c2..6f42a3e 100644 |
11 |
--- git-changebar/src/gcb-plugin.c |
12 |
+++ git-changebar/src/gcb-plugin.c |
13 |
@@ -36,6 +36,15 @@ |
14 |
# define git_libgit2_init git_threads_init |
15 |
# define git_libgit2_shutdown git_threads_shutdown |
16 |
#endif |
17 |
+#if ! defined (LIBGIT2_SOVERSION) || LIBGIT2_SOVERSION < 23 |
18 |
+/* 0.23 added @p binary_cb */ |
19 |
+# define git_diff_buffers(old_buffer, old_len, old_as_path, \ |
20 |
+ new_buffer, new_len, new_as_path, options, \ |
21 |
+ file_cb, binary_cb, hunk_cb, line_cb, payload) \ |
22 |
+ git_diff_buffers (old_buffer, old_len, old_as_path, \ |
23 |
+ new_buffer, new_len, new_as_path, options, \ |
24 |
+ file_cb, hunk_cb, line_cb, payload) |
25 |
+#endif |
26 |
|
27 |
|
28 |
GeanyPlugin *geany_plugin; |
29 |
@@ -656,7 +665,8 @@ diff_buf_to_doc (const git_buf *old_buf, |
30 |
opts.flags = GIT_DIFF_FORCE_TEXT; |
31 |
|
32 |
ret = git_diff_buffers (old_buf->ptr, old_buf->size, NULL, |
33 |
- buf, len, NULL, &opts, NULL, hunk_cb, NULL, payload); |
34 |
+ buf, len, NULL, &opts, NULL, NULL, hunk_cb, NULL, |
35 |
+ payload); |
36 |
|
37 |
if (free_buf) { |
38 |
g_free (buf); |