r-lib / gert

Simple git client for R
https://docs.ropensci.org/gert/
Other
148 stars 31 forks source link

`git_clone()` should treat SSH URLs the same way as `git clone` #192

Open francisbarton opened 1 year ago

francisbarton commented 1 year ago

If I do:

# uses URL as copied from Code dropdown in a GitHub repo
gert::git_clone("git@github.com:francisbarton/myrepo.git")

then it clones into a folder called myrepo.git. If I remove the .git from the end of the URL then it clones into a myrepo folder, as desired.

The behaviour above is (IMHO) sub-optimal, as I would expect the folder created to match the repo name (i.e. without the .git suffix).

If at the terminal I run

git clone git@github.com:francisbarton/myrepo.git

then it clones into a folder called myrepo. I think gert::git_clone() should do the same.