Skip to content

Commit 1ae6833

Browse files
authored
try fix (#269)
Co-Authored-By: Claude Opus 4.6
1 parent 739d655 commit 1ae6833

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)