Resolve magit-git-executable to absolute path

For minor performance gain for macOS/Windows users. Shouldn't make a
difference on Linux.
This commit is contained in:
Henrik Lissner 2020-05-21 01:31:51 -04:00
parent 090a68ab8f
commit 93d188e6bc
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -16,7 +16,11 @@
;; Don't autosave repo buffers. This is too magical, and saving can ;; Don't autosave repo buffers. This is too magical, and saving can
;; trigger a bunch of unwanted side-effects, like save hooks and ;; trigger a bunch of unwanted side-effects, like save hooks and
;; 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
;; Magit runs git *a lot*. Having to scan your PATH so many times can
;; add up with each invokation, especially on Catalina (macOS) or
;; Windows, so we resolve it once.
magit-git-executable (executable-find magit-git-executable))
(defadvice! +magit-revert-repo-buffers-deferred-a (&rest _) (defadvice! +magit-revert-repo-buffers-deferred-a (&rest _)
:after '(magit-checkout magit-branch-and-checkout) :after '(magit-checkout magit-branch-and-checkout)