Remote storage: second attempt to fix build with older libgit2

That was embarrassing...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-05-28 21:43:32 -07:00
parent 64ba7f8683
commit 29e7459d6b

View file

@ -108,12 +108,14 @@ 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 USE_LIBGIT23_API
git_fetch_options opts = GIT_FETCH_OPTIONS_INIT;
if (strncmp(remote, "ssh://", 6) == 0)
opts.callbacks.credentials = credential_cb;
#endif
error = git_remote_fetch(origin, NULL, &opts, NULL);
#else
error = git_remote_fetch(origin, NULL, NULL, NULL);
#endif
git_remote_free(origin);
if (error) {
report_error("Unable to update cache for remote '%s'", remote);