Skip to content
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 fails to install with SHA ref #389

Closed
MilesMcBain opened this issue Jun 21, 2019 · 0 comments
Closed

install_git fails to install with SHA ref #389

MilesMcBain opened this issue Jun 21, 2019 · 0 comments

Comments

@MilesMcBain
Copy link

When an SHA is given for ref in install_git() with git = "external" it fails with

Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
  no lines available in input

This seems to be because remote_sha.xgit_remote tries to execute a command equivalent to:

git ls-remote https://github.com/milesmcbain/datapasta.git dddf83b317254c495c38897bf857a9e6a032070f

Which returns no output.

I see this case is handled in remote_sha.git2r_remote with this this code:

    # If none found, it is either a SHA, so return the pinned sha or NA
    if (length(found) == 0) {
      return(remote$ref %||% NA_character_)
    }

And I believe a similar strategy would resolve this issue, e.g.

 refs <- git(paste("ls-remote", url, ref))

    if (length(refs) == 0) {
      return(remote$ref %||% NA_character_)
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant