Skip to content

Commit 6097dbf

Browse files
committed
Pass the caller through
1 parent 85b31f0 commit 6097dbf

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

R/utils-git.R

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,11 @@ git_uncommitted <- function(untracked = FALSE) {
188188
nrow(git_status(untracked)) > 0
189189
}
190190

191-
challenge_uncommitted_changes <- function(untracked = FALSE, msg = NULL) {
191+
challenge_uncommitted_changes <- function(
192+
untracked = FALSE,
193+
msg = NULL,
194+
error_call = caller_env()
195+
) {
192196
if (!uses_git()) {
193197
return(invisible())
194198
}
@@ -207,7 +211,8 @@ challenge_uncommitted_changes <- function(untracked = FALSE, msg = NULL) {
207211
ui_abort(
208212
"
209213
There are uncommitted changes.
210-
Please commit or stash before continuing."
214+
Please commit or stash before continuing.",
215+
call = error_call
211216
)
212217
}
213218

@@ -223,7 +228,7 @@ challenge_uncommitted_changes <- function(untracked = FALSE, msg = NULL) {
223228
)
224229

225230
if (choice == 0 || choice == 1) {
226-
ui_abort("Cancelling.")
231+
ui_abort("Cancelling.", call = error_call)
227232
} else if (choice == 2) {
228233
# Loop will re-check git_uncommitted()
229234
} else if (choice == 3) {

0 commit comments

Comments
 (0)