mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-10-02 14:13:48 +00:00
Fix fallback for failed ssh public key auth
This commit is contained in:
parent
795c4f17fe
commit
1f0f2a415c
|
@ -249,7 +249,7 @@ public class CredentialsManager
|
|||
string? username,
|
||||
Ggit.Credtype allowed_types) throws Error
|
||||
{
|
||||
if (d_remote.authentication_error != null && (allowed_types & Ggit.Credtype.SSH_KEY) != 0)
|
||||
if (d_remote.authentication_error == null && (allowed_types & Ggit.Credtype.SSH_KEY) != 0)
|
||||
{
|
||||
return new Ggit.CredSshKeyFromAgent(username);
|
||||
}
|
||||
|
|
|
@ -113,8 +113,10 @@ public class Remote : Ggit.Remote
|
|||
catch (Error e)
|
||||
{
|
||||
// NOTE: need to check the message for now in case of failed
|
||||
// http auth.
|
||||
if (e.message == "Unexpected HTTP status code: 401")
|
||||
// http or ssh auth. This is fragile and will likely break
|
||||
// in future libgit2 releases. Please fix!
|
||||
if (e.message == "Unexpected HTTP status code: 401" ||
|
||||
e.message == "error authenticating: Username/PublicKey combination invalid")
|
||||
{
|
||||
d_authentication_error = e;
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue