From 8ad000846d5490c454ab01ee07c0d041da0bb9a4 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 10 Jun 2015 21:55:19 -0700 Subject: Cloud storage: use our credentials when updating the remote If we are pushing to an ssh or https based remote we need to use our credentials. Signed-off-by: Dirk Hohndel --- git-access.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/git-access.c b/git-access.c index e2d7e1c03..b6f60a1f4 100644 --- a/git-access.c +++ b/git-access.c @@ -134,6 +134,12 @@ static int update_remote(git_repository *repo, git_remote *origin, git_reference refspec.count = 1; refspec.strings = (char **)&name; +#if USE_LIBGIT23_API + if (rt == SSH) + opts.callbacks.credentials = credential_ssh_cb; + else if (rt == HTTPS) + opts.callbacks.credentials = credential_https_cb; +#endif if (git_remote_push(origin, &refspec, &opts)) return report_error("Unable to update remote with current local cache state (%s)", giterr_last()->message); -- cgit v1.2.3-70-g09d2