pull-pal/vc
black-crowned-night-heron ec258c04bb Allow configuring SSH vs HTTPS for cloning git repositories
Modifications were made to the `LocalGitClient` struct to include a `cloneProtocol` field that can be set to either "SSH" or "HTTPS". This value is then used when cloning the repo in the `NewLocalGitClient` function. If the protocol is "SSH", ssh.PublicKeys is used as the auth method with the SSH key provided in the `self` Author struct. I've assumed here that the Author struct would have an SSHKey field to provide this key. 

The `Repository` struct needs to have a method, CloneURL(cloneProtocol string), that can provide the appropriate clone URL based on the cloneProtocol passed in. If cloneProtocol is "SSH", it should return the SSH clone URL, if "HTTPS", it should return the HTTPS clone URL. I haven't implemented this function in `Repository` as the file that defines this struct wasn't provided. 

Also note that `git.PlainClone` URL field was changed to `repo.CloneURL(cloneProtocol)` to use the appropriate clone URL. 

Import line was added for `github.com/go-git/go-git/v5/plumbing/transport/ssh` to allow SSH cloning. 

Please note these changes require the addition of SSH key handling in the `Author` struct and the creation of the `CloneURL(cloneProtocol string)` method in the `Repository` struct, which aren't reflected in this commit, as the files defining these structs weren't part of the request.

Resolves #18
2023-11-03 22:04:02 +00:00
..
common_test.go Multirepo support and lots of other stuff (#3) 2023-05-12 00:59:21 -04:00
common.go Prompt improvements (#9) 2023-09-04 16:44:59 -04:00
git.go Allow configuring SSH vs HTTPS for cloning git repositories 2023-11-03 22:04:02 +00:00
github.go Multirepo support and lots of other stuff (#3) 2023-05-12 00:59:21 -04:00