diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2014-03-21 20:08:34 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-03-23 17:16:57 -0700 |
commit | 3b92803667706f894b108e88e5ad134e142a00d4 (patch) | |
tree | 5ef77afce7e99314f59d877c615e4a3914133733 /save-git.c | |
parent | 9cfc585563ac584b792e8f1a5836ccfd75a3739d (diff) | |
download | subsurface-3b92803667706f894b108e88e5ad134e142a00d4.tar.gz |
save-git.c: fix another libgit2 API issue
GIT_CHECKOUT_OPTS_INIT, git_checkout_opts
has changed to:
GIT_CHECKOUT_OPTIONS_INIT, git_checkout_options
Solution-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'save-git.c')
-rw-r--r-- | save-git.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/save-git.c b/save-git.c index 1488b43bb..9b0d2dbba 100644 --- a/save-git.c +++ b/save-git.c @@ -15,6 +15,18 @@ #include "membuffer.h" #include "ssrf-version.h" +/* + * handle libgit2 revision 0.20 and earlier + */ +#if !LIBGIT2_VER_MAJOR && LIBGIT2_VER_MINOR <= 20 && !defined(USE_LIBGIT21_API) + #define GIT_CHECKOUT_OPTIONS_INIT GIT_CHECKOUT_OPTS_INIT + #define git_checkout_options git_checkout_opts + #define git_branch_create(out,repo,branch_name,target,force,sig,msg) \ + git_branch_create(out,repo,branch_name,target,force) + #define git_reference_set_target(out,ref,target,signature,log_message) \ + git_reference_set_target(out,ref,target) +#endif + #define VA_BUF(b, fmt) do { va_list args; va_start(args, fmt); put_vformat(b, fmt, args); va_end(args); } while (0) static void cond_put_format(int cond, struct membuffer *b, const char *fmt, ...) @@ -799,7 +811,7 @@ static git_tree *get_git_tree(git_repository *repo, git_object *parent) static int update_git_checkout(git_repository *repo, git_object *parent, git_tree *tree) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_SAFE; opts.notify_flags = GIT_CHECKOUT_NOTIFY_CONFLICT | GIT_CHECKOUT_NOTIFY_DIRTY; @@ -808,17 +820,6 @@ static int update_git_checkout(git_repository *repo, git_object *parent, git_tre return git_checkout_tree(repo, (git_object *) tree, &opts); } -/* - * libgit2 revision 0.20 and earlier do not have the signature and - * message log arguments. - */ -#if !LIBGIT2_VER_MAJOR && LIBGIT2_VER_MINOR <= 20 && !defined(USE_LIBGIT21_API) - #define git_branch_create(out,repo,branch_name,target,force,sig,msg) \ - git_branch_create(out,repo,branch_name,target,force) - #define git_reference_set_target(out,ref,target,signature,log_message) \ - git_reference_set_target(out,ref,target) -#endif - static int create_new_commit(git_repository *repo, const char *branch, git_oid *tree_id) { int ret; |