summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-05-28 16:09:29 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-05-28 16:09:29 -0700
commitc6e0b744520d52c4f07801a52f580538017ab568 (patch)
treec4ad81e8c056a26d98462055ac5d780937b76d61
parent61c0d0c73d46515faa7d3dd2a63a19c43e437496 (diff)
downloadsubsurface-c6e0b744520d52c4f07801a52f580538017ab568.tar.gz
Remote storage: turns out you need a newer libgit2
I was afraid that this would only work with a farily current git master of libgit2 and it turns out I was right. The API was available, but the correct type wasn't. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--git-access.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/git-access.c b/git-access.c
index 9feea0069..c63f933d8 100644
--- a/git-access.c
+++ b/git-access.c
@@ -69,7 +69,7 @@ static int try_to_update(git_repository *rep, git_reference *local, git_referenc
return report_error("Local and remote do not match, not updating");
}
-#if LIBGIT2_VER_MAJOR || LIBGIT2_VER_MINOR >= 20
+#if USE_LIBGIT23_API
int credential_cb(git_cred **out,
const char *url,
const char *username_from_url,
@@ -109,7 +109,7 @@ static git_repository *update_local_repo(const char *localdir, const char *remot
// NOTE! A fetch error is not fatal, we just report it
git_fetch_options opts = GIT_FETCH_OPTIONS_INIT;
-#if LIBGIT2_VER_MAJOR || LIBGIT2_VER_MINOR >= 20
+#if USE_LIBGIT23_API
if (strncmp(remote, "ssh://", 6) == 0)
opts.callbacks.credentials = credential_cb;
#endif
@@ -147,7 +147,7 @@ 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;
-#if LIBGIT2_VER_MAJOR || LIBGIT2_VER_MINOR >= 20
+#if USE_LIBGIT23_API
if (strncmp(remote, "ssh://", 6) == 0)
opts.fetch_opts.callbacks.credentials = credential_cb;
#endif