diff --git a/R/pr.R b/R/pr.R index 2af8a5dfb..79da47e89 100644 --- a/R/pr.R +++ b/R/pr.R @@ -208,7 +208,7 @@ pr_init <- function(branch) { if (!is.na(remref)) { comparison <- git_branch_compare(current_branch, remref) if (comparison$remote_only > 0) { - challenge_uncommitted_changes() + challenge_uncommitted_changes(which = c("pull", "switch branches")) } ui_bullets(c("v" = "Pulling changes from {.val {remref}}.")) git_pull(remref = remref, verbose = FALSE) @@ -258,7 +258,7 @@ pr_resume <- function(branch = NULL) { )) } - challenge_uncommitted_changes(which = "switch") + challenge_uncommitted_changes(which = c("pull", "switch", "compare branches")) ui_bullets(c("v" = "Switching to branch {.val {branch}}.")) gert::git_branch_checkout(branch, repo = repo) @@ -283,7 +283,7 @@ pr_resume <- function(branch = NULL) { pr_fetch <- function(number = NULL, target = c("source", "primary")) { repo <- git_repo() tr <- target_repo(github_get = NA, role = target, ask = FALSE) - challenge_uncommitted_changes(which = "switch") + challenge_uncommitted_changes(which = c("pull", "switch branches")) if (is.null(number)) { ui_bullets(c("i" = "No PR specified ... looking up open PRs.")) @@ -503,7 +503,7 @@ pr_pause <- function() { )) return(invisible()) } - challenge_uncommitted_changes(which = "switch") + challenge_uncommitted_changes(which = "switch branches") # TODO: what happens here if offline? check_branch_pulled(use = "pr_pull()") diff --git a/R/utils-git.R b/R/utils-git.R index 178994bd8..31287a79d 100644 --- a/R/utils-git.R +++ b/R/utils-git.R @@ -215,7 +215,6 @@ challenge_uncommitted_changes <- function( "Uncommitted changes. Please commit before continuing.", call = caller_env() ) - return(invisible()) } } }