aboutsummaryrefslogtreecommitdiff
path: root/lisp/magit-gitignore.el
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2023-03-17 18:51:10 +0100
committerJonas Bernoulli <jonas@bernoul.li>2023-03-17 18:51:10 +0100
commitff4710afa6e92fd3e22bbc6163153a5fd1019337 (patch)
tree37af35cdcea10a88f597fc68358af3a58d66ac96 /lisp/magit-gitignore.el
parent860648857875ca904c4b7b4678f7b8692296bb24 (diff)
Deprecate magit-git-dir to avoid needlessly repeating work
Five years ago in [1: 5f407a29ac] we took the first step toward this. 1: 2018-10-15 5f407a29ac63b338c3c75e30b4633b44d5745036 magit-gitdir: New function Previously we cached the wrong thing. `expand-file-name' is cheap but "git rev-parse --git-dir" is not. Because `magit-git-dir' is where we cached, rev-parse was still needlessly called multiple times with the same arguments during a refresh. The effect should be most noticeable during a rebase.
Diffstat (limited to 'lisp/magit-gitignore.el')
-rw-r--r--lisp/magit-gitignore.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/magit-gitignore.el b/lisp/magit-gitignore.el
index ec89042..5a47fbf 100644
--- a/lisp/magit-gitignore.el
+++ b/lisp/magit-gitignore.el
@@ -84,7 +84,7 @@ Also stage the file."
"Add the Git ignore RULE to \"$GIT_DIR/info/exclude\".
Rules in that file only affects this clone of the repository."
(interactive (list (magit-gitignore-read-pattern)))
- (magit--gitignore rule (magit-git-dir "info/exclude"))
+ (magit--gitignore rule (expand-file-name "info/exclude" (magit-gitdir)))
(magit-refresh))
;;;###autoload