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
install_git() Assumes github-style urls and credential-less web server access #625
Comments
|
Thanks @jimhester (& thanks @niheaven for your work on this already - it's generally worked perfectly with only this slight hiccup!) @niheaven - would it be okay to add such a fallback? if (grepl("^https?://", remote$url)) {
+ tryCatch({
url <- build_url(sub("\\.git$", "", remote$url), "raw", remote_sha(remote, ...), description_path)
download(tmp, url)
read_dcf(tmp)$Package
+ }, error = function(e) NA_character_)
}Wrapping this in a |
|
@dgkf |
Despite being able to clone a repository in the command line, I was running into errors using
install_gitto install dependencies. After some investigation, I found a few assumptions that might contribute to errors:remotes/R/install-git.R
Lines 148 to 151 in a14cf00
These lines in
remote_package_name.git2r_remoteassume a github-style raw file content url without a safe fallback.For example, where GitHub will useEdit: after further testing, the GitHub style is totally fine for GitLab..../raw/<ref>/<path>, GitLab will use.../-/raw/<ref>/<path>.Likewise, this assumes that one has unauthenticated access to these web pages. At least in my org, I run into the error below because
read.dcfis trying to parse the log-in page that unauthenticated access redirects to.Would it be possible to fall back to return
NAor fall back to a method that only assumes a basic git functionality when such assumptions cause errors?The text was updated successfully, but these errors were encountered: