emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/git-commit 9b94654921 9/9: Remove redundant version/featur


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 9b94654921 9/9: Remove redundant version/feature caches
Date: Tue, 22 Feb 2022 05:58:10 -0500 (EST)

branch: elpa/git-commit
commit 9b94654921d511ff80d48122481cde02828492db
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Remove redundant version/feature caches
    
    Functions that compare the Git version on the current host with the
    required version use `magit-git-version', which caches the used
    version per host.
    
    The result of comparing two versions is not cached, which increases
    the cost slightly because they have to be converted to the internal
    list format before comparison can happen.  `magit-git-version' uses
    the refresh cache, making the effect negligible.
---
 lisp/magit-diff.el | 10 ++--------
 lisp/magit-wip.el  |  9 +--------
 2 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index 96b32f708f..dcff92c65d 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -2053,15 +2053,9 @@ Staging and applying changes is documented in info node
                (remove "--literal-pathspecs" magit-git-global-arguments)))
     ;; As of Git 2.19.0, we need to generate diffs with
     ;; --ita-visible-in-index so that `magit-stage' can work with
-    ;; intent-to-add files (see #4026).  Cache the result for each
-    ;; repo to avoid a `git version' call for every diff insertion.
+    ;; intent-to-add files (see #4026).
     (when (and (not (equal cmd "merge-tree"))
-               (pcase (magit-repository-local-get 'diff-ita-kludge-p 'unset)
-                 (`unset
-                  (let ((val (magit-git-version>= "2.19.0")))
-                    (magit-repository-local-set 'diff-ita-kludge-p val)
-                    val))
-                 (val val)))
+               (magit-git-version>= "2.19.0"))
       (push "--ita-visible-in-index" args))
     (setq args (magit-diff--maybe-add-stat-arguments args))
     (when (cl-member-if (lambda (arg) (string-prefix-p "--color-moved" arg)) 
args)
diff --git a/lisp/magit-wip.el b/lisp/magit-wip.el
index 7f42b573d7..d5c8072b8d 100644
--- a/lisp/magit-wip.el
+++ b/lisp/magit-wip.el
@@ -301,14 +301,7 @@ commit message."
                        ;; deleted in the temporary index.
                        (magit-call-git
                         "update-index" "--add" "--remove"
-                        (and (pcase (magit-repository-local-get
-                                     'update-index-has-ignore-sw-p 'unset)
-                               (`unset
-                                (let ((val (magit-git-version>= "2.25.0")))
-                                  (magit-repository-local-set
-                                   'update-index-has-ignore-sw-p val)
-                                  val))
-                               (val val))
+                        (and (magit-git-version>= "2.25.0")
                              "--ignore-skip-worktree-entries")
                         "--" files)
                      (magit-with-toplevel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]