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.
# Okusethis:::pr_find("maurolepore", repo="with-some-pr", pr_branch="new")
#> character(0)# Failsusethis:::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)
Fixesr-lib#990
The is the minimal fix, maybe too terse. A more expressive
solution comes in a separate commit, to allow reverting it if you
prefer the shorter solution.
The tests will also come in a separate commit because they test
the internal `pr_find()` instead of the exported `pr_push()`. You
may want to revert that upcomming commit too.
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 returnscharacter()
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.Created on 2020-01-29 by the reprex package (v0.3.0.9001)
cc' @uni-sabia
The text was updated successfully, but these errors were encountered: