Skip to content

Commit 70e17a2

Browse files
committed
Tweak message to make it shorter.
1 parent a0835db commit 70e17a2

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

R/utils-git.R

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,22 @@ challenge_uncommitted_changes <- function(
193193
rstudioapi::documentSaveAll()
194194
}
195195

196-
default_msg <- "
197-
There are uncommitted changes, which may cause problems or be lost when \\
198-
we {.or {which}}"
199-
msg <- glue(msg %||% default_msg)
200-
if (git_uncommitted(untracked = untracked)) {
201-
if (ui_yep(c(
202-
"!" = msg,
203-
" " = "Do you want to proceed anyway?"
204-
))) {
196+
default_msg <-
197+
"Uncommitted changes may cause problems or be lost when we {.or {which}}."
198+
msg <- cli::format_inline(msg %||% default_msg)
199+
200+
uncommited <- git_status(untracked)
201+
if (nrow(uncommited) > 0) {
202+
choice <- utils::menu(
203+
c(
204+
"I want to proceed anyway.",
205+
cli::format_inline(
206+
"I want to take a closer look at {.file {uncommited$file}} first."
207+
)
208+
),
209+
title = msg
210+
)
211+
if (choice == 1) {
205212
return(invisible())
206213
} else {
207214
ui_abort("Uncommitted changes. Please commit before continuing.", call = NULL)

0 commit comments

Comments
 (0)