davidB / git2_credentials

Provide credentials function to used with git2::RemoteCallbacks.credentials
Apache License 2.0
21 stars 4 forks source link

Credentials for SSH without username always failure #44

Closed gifnksm closed 12 months ago

gifnksm commented 12 months ago

When cloning over SSH without a username, CredentialHelper::try_next_credential() always fails with the error "gonna try usernames later".

According to Cargo's utils.rs, username will always be None if CredentialType::USERNAME is enabled. The git2_credentials system is supposed to fall back to another username on authentication failure, but it doesn't seem to work correctly because the error is returned first.