summaryrefslogtreecommitdiffstats
path: root/git-access.c
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2015-09-11 00:13:54 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-10 15:30:12 -0700
commit906cc8804d746dffaf4e971e366d269662d45985 (patch)
tree24d2464290651743a1fb3db26b8af6dae8a5bd80 /git-access.c
parent948c77bfad603b7d3f3acef806e94b825ae3bb77 (diff)
downloadsubsurface-906cc8804d746dffaf4e971e366d269662d45985.tar.gz
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 <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'git-access.c')
-rw-r--r--git-access.c4
1 files 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)