Skip to content

Commit

Permalink
checklist summary() displays only the unstaged changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ThierryO committed Jul 14, 2024
1 parent 6f5a189 commit 5d65cc6
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -331,17 +331,11 @@ checklist_diff <- function(root) {
if (inherits(try(git_info(repo = root), silent = TRUE), "try-error")) {
return(invisible(NULL))
}
branch_info <- git_branch_list(repo = root)
branch_info$ref[
grep("/main$", branch_info$ref) |>
c(grep("/master$", branch_info$ref)) |>
head(1)
] |>
git_diff(repo = root) -> changes
changes <- git_diff(repo = root)
if (length(changes) == 0) {
return(invisible(NULL))
}
cli_h1("git diff")
cli_h1("unstaged changes")
changes$patch |>
gsub(pattern = "^.*?index.*?\n.*?\n", replacement = "") |>
strsplit(split = "\n") |>
Expand Down

0 comments on commit 5d65cc6

Please sign in to comment.