From 5e6363f025837c789e4f5b313b4ebbc7e60ae444 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 29 Oct 2019 10:46:13 -0400 Subject: [PATCH] tools/magit: invalidate projectile cache on git checkout --- modules/tools/magit/config.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/tools/magit/config.el b/modules/tools/magit/config.el index a7eb190a3..483327e7d 100644 --- a/modules/tools/magit/config.el +++ b/modules/tools/magit/config.el @@ -26,6 +26,11 @@ It is passed a user and repository name.") ;; formatters. Trust us to know what we're doing. 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 ;; ~/.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