Skip to content

Commit

Permalink
Pretty check_only_modified()
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Jul 7, 2023
1 parent 2ad2d4b commit feca684
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions R/commit-version.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ check_clean <- function(forbidden_modifications) {

check_only_modified <- function(allowed_modifications) {
status <- gert::git_status()
if (nrow(status) > 0) {
cli::cli_alert_danger("Found untracked/unstaged/staged files in the git index:
{.file {unlist(status$file)}}. Please commit or discard them and
try again.", wrap = TRUE)
if (!all(status$file %in% allowed_modifications)) {
cli_abort(c(
x = "Found untracked/unstaged/staged files in the git index: {.file {status$file}}.",
i = "Please commit or discard them and try again."
))
}
stopifnot(all(unlist(status) %in% allowed_modifications))
}

check_only_staged <- function(allowed_modifications) {
Expand Down

0 comments on commit feca684

Please sign in to comment.