Skip to content

Commit 86c461a

Browse files
authored
Merge branch 'main' into restore
2 parents 860ff25 + 1ae6833 commit 86c461a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

R/remotes.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ git_remote_set_pushurl <- function(
8181
if (!length(remote)) {
8282
remote <- git_info(repo = repo)$remote
8383
}
84+
if (!length(remote) || is.na(remote)) {
85+
stop("No remote specified and none could be detected", call. = FALSE)
86+
}
87+
existing <- git_remote_list(repo = repo)$name
88+
if (!remote %in% existing) {
89+
stop(sprintf("remote '%s' does not exist", remote), call. = FALSE)
90+
}
8491
url <- as.character(url)
8592

8693
git_config_set(

0 commit comments

Comments
 (0)