Add USE_LIBGIT23_API as cmake option

Just as we would expect, the libgit2 developers of course once again broke
their API. In order to compile against current master we need to remap
those APIs once again.

Simply call cmake with -DUSE_LIBGIT23_API

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-05-28 09:13:51 -07:00
parent 8af85fbc04
commit 95664af53b
3 changed files with 26 additions and 0 deletions

View file

@ -34,6 +34,15 @@
#else
#define git_treebuilder_write(id, repo, bld) git_treebuilder_write(id, bld)
#endif
/*
* api break introduced in libgit2 master after 0.22 - let's guess this is the v0.23 API
*/
#if USE_LIBGIT23_API
#define git_branch_create(out, repo, branch_name, target, force, signature, log_message) \
git_branch_create(out, repo, branch_name, target, force)
#define git_reference_set_target(out, ref, id, author, log_message) \
git_reference_set_target(out, ref, id, log_message)
#endif
#define VA_BUF(b, fmt) do { va_list args; va_start(args, fmt); put_vformat(b, fmt, args); va_end(args); } while (0)