mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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>
This commit is contained in:
parent
26cbc32495
commit
8ad000846d
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue