From 906cc8804d746dffaf4e971e366d269662d45985 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Fri, 11 Sep 2015 00:13:54 +0200 Subject: Be compatible with libgit2 0.22 again The callback function was introduced in 0.23, so put it behind that ifdef. Signed-off-by: Anton Lundin Signed-off-by: Dirk Hohndel --- git-access.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-access.c b/git-access.c index a9e411e65..b133a7622 100644 --- a/git-access.c +++ b/git-access.c @@ -203,7 +203,6 @@ int certificate_check_cb(git_cert *cert, int valid, const char *host, void *payl static int update_remote(git_repository *repo, git_remote *origin, git_reference *local, git_reference *remote, enum remote_transport rt) { git_push_options opts = GIT_PUSH_OPTIONS_INIT; - opts.callbacks.push_transfer_progress = &push_transfer_progress_cb; git_strarray refspec; const char *name = git_reference_name(local); @@ -211,6 +210,7 @@ static int update_remote(git_repository *repo, git_remote *origin, git_reference refspec.strings = (char **)&name; #if USE_LIBGIT23_API + opts.callbacks.push_transfer_progress = &push_transfer_progress_cb; if (rt == RT_SSH) opts.callbacks.credentials = credential_ssh_cb; else if (rt == RT_HTTPS) @@ -527,8 +527,8 @@ static git_repository *create_local_repo(const char *localdir, const char *remot int error; git_repository *cloned_repo = NULL; git_clone_options opts = GIT_CLONE_OPTIONS_INIT; - opts.fetch_opts.callbacks.transfer_progress = &transfer_progress_cb; #if USE_LIBGIT23_API + opts.fetch_opts.callbacks.transfer_progress = &transfer_progress_cb; if (rt == RT_SSH) opts.fetch_opts.callbacks.credentials = credential_ssh_cb; else if (rt == RT_HTTPS) -- cgit v1.2.3-70-g09d2