Skip to content

install_git fails to install with SHA ref #389

@MilesMcBain

Description

@MilesMcBain

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_)
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions