fix(magit): projectile-invalidate-cache in wrong buffer

Also prevents projectile prompting in non-projects.
This commit is contained in:
Henrik Lissner
2025-04-12 23:58:36 -04:00
parent 1c09989e48
commit b2f8529683

View File

@ -73,9 +73,10 @@ FUNCTION
;; Since the project likely now contains new files, best we undo the
;; projectile cache so it can be regenerated later.
(add-hook! 'magit-post-refresh-hook
(add-hook! 'magit-refresh-buffer-hook
(defun +magit-invalidate-projectile-cache-h ()
(projectile-invalidate-cache nil)))
(let (projectile-require-project-root)
(projectile-invalidate-cache nil))))
;; Use a more efficient strategy to auto-revert buffers whose git state has
;; changed: refresh the visible buffers immediately...
(add-hook 'magit-post-refresh-hook #'+magit-mark-stale-buffers-h)