Let the repository's origin
remote has an ssh url.
So the following code:
remote = Rugged::Remote.lookup(repo, "origin")
remote.connect(:fetch)
raises Rugged::SshError: Cannot set up SSH connection without credentials
.
It looks like rugged
supports SSH transport, since there is Rugged::Credentials::SshKey
class and it is possible to provide :credentials
option for Repository.clone_at
.
But I don't see any way to provide credentials for Remote#connect
in a source code. Am I missing something?
And if it's possible to connect over ssh, is there any way to get credentials from ssh-agent?
Seems libgit2
can query ssh-agent.