Make failure to connect to ssh-agent non-fatal

Fixes https://github.com/libgit2/libgit2/issues/3866

Has been applied in all Julia builds since 2017:
https://github.com/JuliaLang/julia/pull/17459

Authored-by: Keno Fischer <kfischer@college.harvard.edu>
This commit is contained in:
Francois-Xavier Coudert
2023-02-22 10:52:06 +01:00
parent 5561070c37
commit d286952f9e

View File

@@ -246,8 +246,10 @@ static int ssh_agent_auth(LIBSSH2_SESSION *session, git_credential_ssh_key *c) {
rc = libssh2_agent_connect(agent);
if (rc != LIBSSH2_ERROR_NONE)
if (rc != LIBSSH2_ERROR_NONE) {
rc = LIBSSH2_ERROR_AUTHENTICATION_FAILED;
goto shutdown;
}
rc = libssh2_agent_list_identities(agent);