summaryrefslogtreecommitdiffstats
path: root/git-access.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-10 21:55:19 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-10 21:55:19 -0700
commit8ad000846d5490c454ab01ee07c0d041da0bb9a4 (patch)
treec1e4ca6d432b3032f9e558dbad00b4ef6e684938 /git-access.c
parent26cbc324958fb506e6e7afaa674017cf75f0d9f3 (diff)
downloadsubsurface-8ad000846d5490c454ab01ee07c0d041da0bb9a4.tar.gz
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 <dirk@hohndel.org>
Diffstat (limited to 'git-access.c')
-rw-r--r--git-access.c6
1 files changed, 6 insertions, 0 deletions
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);