-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: clone when user use ssh #113
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @AlexD10S. Only mandating changes in the error handler for git2:Config
. Rest looks good.
TBF, I still do not understand how to replicate this issue because we are straight up asking git config --global url."[email protected]:".insteadOf "https://github.com/" |
Some people set up their git configuration to clone the repositories using SSH using Before this fixes you can try: git config --global url."[email protected]:".insteadOf "https://github.com/" And this will throw an error when try to clone, because even pop has https:: your git will go with the new configuration. See this issue: rust-lang/git2-rs#901 |
A user reported an issue when generating the parachain:
It seem our current code for cloning a repository was throwing an error, fixed using
RepoBuilder
. Based on this example: https://docs.rs/git2/0.13.1/git2/build/struct.RepoBuilder.html#exampleAfter that fix user was having another issue:
With seems is an issue authenticating for the SSH clone. Fixed using the library: https://crates.io/crates/git2_credentials
Also I removed
Repository::init(target)?;
frominstantiate_base_template
. After this PR #65 where we where the git init repo was introduced it gets duplicated.How to replicate the issue:
This is tricky, I wasn't able to get same issue as the user, but if you change your way to clone, to use SSH you will see an error too in current main:
git config --global url."[email protected]:".insteadOf "https://github.com/"
A guide on how to set up SSH cloning:
https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/github-clone-with-ssh-keys