Function: diff-hl-reset-reference-rev-in-project

diff-hl-reset-reference-rev-in-project is an interactive and natively compiled function defined in diff-hl.el.

Signature

(diff-hl-reset-reference-rev-in-project &optional PROJ)

Documentation

Reset the reference revision in the project PROJ to the global value.

PROJ defaults to the current project.

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/cfz56rl3lp066226i0bmmgiicls3gcq7-emacs-packages-deps/share/emacs/site-lisp/elpa/diff-hl-20261001.135/diff-hl.el
(defun diff-hl-reset-reference-rev-in-project (&optional proj)
  "Reset the reference revision in the project PROJ to the
global value.

PROJ defaults to the current project."
  (interactive)
  (when-let* ((proj (or proj (project-current))))
    ;; reset cache for the project
    (setq diff-hl-reference-revision-projects-cache
          (assoc-delete-all (diff-hl--project-root proj)
                            diff-hl-reference-revision-projects-cache
                            #'string-equal))
    ;; reset value in project buffers
    (dolist (buf (project-buffers proj))
      (with-current-buffer buf
        (when diff-hl-mode
          (when (bound-and-true-p diff-hl-amend-mode)
            (diff-hl-amend-mode -1))
          (kill-local-variable 'diff-hl-reference-revision)
          (diff-hl-update))))
    (message "Reference revision reset to the global value (project %s)"
             (project-name proj))))