Skip to content

pr_push() with a repo with no-pr yields "Error in prs[[1]]: subscript out of bounds" #990

@maurolepore

Description

@maurolepore

I expected pr_push() to be able to push a new pull request to a repo with no previous pr (e.g. https://github.com/maurolepore/with-no-pr). But instead I get "Error in prs[[1]]: subscript out of bounds".

The problem seems to be in pr_find(). It correctly returns character() with a new pr to a repo with some pr (e.g. https://github.com/maurolepore/with-some-pr). But errors if the new pr is to a repo with no previous pr.

# Ok
usethis:::pr_find("maurolepore", repo = "with-some-pr", pr_branch = "new")
#> character(0)

# Fails
usethis:::pr_find("maurolepore", repo = "with-no-pr", pr_branch = "new")
#> Error in prs[[1]]: subscript out of bounds

Created on 2020-01-29 by the reprex package (v0.3.0.9001)

cc' @uni-sabia

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions