mirror of
https://github.com/Pull-Pal/pull-pal.git
synced 2024-11-03 01:38:33 -04:00
ec258c04bb
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 |
||
---|---|---|
.. | ||
common_test.go | ||
common.go | ||
git.go | ||
github.go |