tools/magit: invalidate projectile cache on git checkout

This commit is contained in:
Henrik Lissner 2019-10-29 10:46:13 -04:00
parent 2a6b1a1fb6
commit 5e6363f025
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -26,6 +26,11 @@ It is passed a user and repository name.")
;; formatters. Trust us to know what we're doing. ;; formatters. Trust us to know what we're doing.
magit-save-repository-buffers nil) magit-save-repository-buffers nil)
(defadvice! +magit-invalidate-projectile-cache-a (&rest _args)
;; We ignore the args to `magit-checkout'.
:after '(magit-checkout magit-branch-and-checkout)
(projectile-invalidate-cache nil))
;; The default location for git-credential-cache is in ;; The default location for git-credential-cache is in
;; ~/.config/git/credential. However, if ~/.git-credential-cache/ exists, then ;; ~/.config/git/credential. However, if ~/.git-credential-cache/ exists, then
;; it is used instead. Magit seems to be hardcoded to use the latter, so here ;; it is used instead. Magit seems to be hardcoded to use the latter, so here