From 2ff33c8d0fefa6539db39d66a699810629d040b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 23 Mar 2026 11:07:49 +0100 Subject: [PATCH] try fix Co-Authored-By: Claude Opus 4.6 --- R/remotes.R | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/R/remotes.R b/R/remotes.R index 1b2731a..78c81d0 100644 --- a/R/remotes.R +++ b/R/remotes.R @@ -81,6 +81,13 @@ git_remote_set_pushurl <- function( if (!length(remote)) { remote <- git_info(repo = repo)$remote } + if (!length(remote) || is.na(remote)) { + stop("No remote specified and none could be detected", call. = FALSE) + } + existing <- git_remote_list(repo = repo)$name + if (!remote %in% existing) { + stop(sprintf("remote '%s' does not exist", remote), call. = FALSE) + } url <- as.character(url) git_config_set(