Skip to content

Commit

Permalink
git-changebar: Add support for libgit2 >= 0.23
Browse files Browse the repository at this point in the history
Closes #283.
  • Loading branch information
b4n committed Sep 10, 2015
1 parent 4b01b16 commit 37aa25a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion git-changebar/src/gcb-plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@
# define git_libgit2_init git_threads_init
# define git_libgit2_shutdown git_threads_shutdown
#endif
#if ! defined (LIBGIT2_SOVERSION) || LIBGIT2_SOVERSION < 23
/* 0.23 added @p binary_cb */
# define git_diff_buffers(old_buffer, old_len, old_as_path, \
new_buffer, new_len, new_as_path, options, \
file_cb, binary_cb, hunk_cb, line_cb, payload) \
git_diff_buffers (old_buffer, old_len, old_as_path, \
new_buffer, new_len, new_as_path, options, \
file_cb, hunk_cb, line_cb, payload)
#endif


GeanyPlugin *geany_plugin;
Expand Down Expand Up @@ -656,7 +665,8 @@ diff_buf_to_doc (const git_buf *old_buf,
opts.flags = GIT_DIFF_FORCE_TEXT;

ret = git_diff_buffers (old_buf->ptr, old_buf->size, NULL,
buf, len, NULL, &opts, NULL, hunk_cb, NULL, payload);
buf, len, NULL, &opts, NULL, NULL, hunk_cb, NULL,
payload);

if (free_buf) {
g_free (buf);
Expand Down

0 comments on commit 37aa25a

Please sign in to comment.