Skip to content

Commit

Permalink
Use github_remote_list() for testing
Browse files Browse the repository at this point in the history
To reduce some of the usage of `github_remotes()` where it's not strictly necessary.
  • Loading branch information
hadley committed Sep 10, 2024
1 parent 2cc9e5a commit 44c896c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions R/utils-github.R
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ new_no_github <- function() {

new_ours <- function() {
remotes <- data.frame(name = "origin", url = "https://github.com/OWNER/REPO.git")
grl <- github_remotes(github_get = FALSE, x = remotes)
grl <- github_remote_list(x = remotes)
grl$github_got <- grl$perm_known <- TRUE
grl$default_branch <- "DEFAULT_BRANCH"

Expand Down Expand Up @@ -917,7 +917,7 @@ new_fork <- function() {
name = c("origin", "upstream"),
url = c("https://github.com/CONTRIBUTOR/REPO.git", "https://github.com/OWNER/REPO.git")
)
grl <- github_remotes(github_get = FALSE, x = remotes)
grl <- github_remote_list(x = remotes)
grl$github_got <- grl$perm_known <- TRUE
grl$default_branch <- "DEFAULT_BRANCH"

Expand All @@ -940,7 +940,7 @@ new_fork <- function() {

new_maybe_ours_or_theirs <- function() {
remotes <- data.frame(name = "origin", url = "https://github.com/OWNER/REPO.git")
grl <- github_remotes(github_get = FALSE, x = remotes)
grl <- github_remote_list(x = remotes)
grl$github_got <-grl$perm_known <- FALSE
grl$default_branch <- "DEFAULT_BRANCH"

Expand All @@ -956,7 +956,7 @@ new_maybe_fork <- function() {
name = c("origin", "upstream"),
url = c("https://github.com/CONTRIBUTOR/REPO.git", "https://github.com/OWNER/REPO.git")
)
grl <- github_remotes(github_get = FALSE, x = remotes)
grl <- github_remote_list(x = remotes)
grl$github_got <-grl$perm_known <- FALSE
grl$default_branch <- "DEFAULT_BRANCH"

Expand All @@ -973,7 +973,7 @@ new_fork_cannot_push_origin <- function() {
name = c("origin", "upstream"),
url = c("https://github.com/CONTRIBUTOR/REPO.git", "https://github.com/OWNER/REPO.git")
)
grl <- github_remotes(github_get = FALSE, x = remotes)
grl <- github_remote_list(x = remotes)
grl$github_got <-grl$perm_known <- TRUE
grl$default_branch <- "DEFAULT_BRANCH"

Expand All @@ -993,7 +993,7 @@ new_fork_upstream_is_not_origin_parent<- function() {
name = c("origin", "upstream"),
url = c("https://github.com/CONTRIBUTOR/REPO.git", "https://github.com/OLD_OWNER/REPO.git")
)
grl <- github_remotes(github_get = FALSE, x = remotes)
grl <- github_remote_list(x = remotes)
grl$github_got <- grl$perm_known <- TRUE
grl$default_branch <- "DEFAULT_BRANCH"

Expand All @@ -1018,7 +1018,7 @@ new_upstream_but_origin_is_not_fork <- function() {
name = c("origin", "upstream"),
url = c("https://github.com/CONTRIBUTOR/REPO.git", "https://github.com/OWNER/REPO.git")
)
grl <- github_remotes(github_get = FALSE, x = remotes)
grl <- github_remote_list(x = remotes)
grl$github_got <-grl$perm_known <- TRUE
grl$default_branch <- "DEFAULT_BRANCH"

Expand Down

0 comments on commit 44c896c

Please sign in to comment.