1

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.

TheBug
  • 121
  • 2

1 Answers1

2

Right now, Rugged does not support arbitrary remote operations with credentials, nor does it support the ssh-agent credential type.

https://github.com/libgit2/rugged/pull/304 is/was supposed to sort that out, but has been neglected for some time due to other things having a higher priority, and is now a bit out-of-touch with the latest changes in Rugged. I want to get this fixed asap, and will then update my answer here. I'll also sneak in support for querying the ssh-agent.

  • I've checked out that PR, and found that `connect` method is gone. How now one can provide credentials for `ls` method? – TheBug Mar 16 '14 at 09:19