r-lib / remotes

Install R packages from GitHub, GitLab, Bitbucket, git, svn repositories, URLs
https://remotes.r-lib.org/
Other
331 stars 152 forks source link

install_git with credentials broken after 2.4.0 #652

Closed camitz closed 2 years ago

camitz commented 3 years ago

Hello!

After remotes 2.4.0, devtools::install_git() passing credentials is broken.

The following works.

devtools::install_version("remotes", version = "2.3.0")
rstudioapi::restartSession()
cred <- git2r::cred_user_pass("martin.camitz", rstudioapi::askForPassword("Lösenord"))
devtools::install_git(url="https://git.folkhalsomyndigheten.se/fohmverse/fohmdown", credentials = cred)

# Downloading git repo https://git.folkhalsomyndigheten.se/fohmverse/fohmdown

The following does not:

devtools::install_version("remotes", version = "2.4.0")
rstudioapi::restartSession()
cred <- git2r::cred_user_pass("martin.camitz", rstudioapi::askForPassword("Lösenord"))
devtools::install_git(url="https://git.folkhalsomyndigheten.se/fohmverse/fohmdown", credentials = cred)

# Error: Failed to install 'unknown package' from Git:
#  Line starting '<!DOCTYPE html> ...' is malformed!

I can give access to whomever needs it to reproduce but any private repository will do och github or gitlab.

I believe @niheaven 's commit is the culprit, install-git.R, around line 148, but I'm only guessing.

baslat commented 2 years ago

Adding that this workaround is also necessary to install a package from Azure DevOps, as the old method has stopped working.

achimgaedke commented 2 years ago

Please check again with https://github.com/r-lib/remotes/pull/658 is included in the next release.

camitz commented 2 years ago

Tested and it appears to work. Thanks for great work @achimgaedke .