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

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

[nongnu] elpa/git-commit b5c0882a4f 2/7: magit-get-boolean: Support usin


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit b5c0882a4f 2/7: magit-get-boolean: Support using scope argument
Date: Tue, 1 Mar 2022 08:58:17 -0500 (EST)

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

    magit-get-boolean: Support using scope argument
    
    As for related functions, leave that undocumented.
---
 lisp/magit-git.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index fcabd0fab9..256a4b73fe 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -731,10 +731,13 @@ See info node `(magit)Debugging Tools' for more 
information."
 (defun magit-get-boolean (&rest keys)
   "Return the boolean value of the Git variable specified by KEYS.
 Also see `magit-git-config-p'."
-  (let ((key (mapconcat 'identity keys ".")))
+  (let ((arg (and (or (null (car keys))
+                      (string-prefix-p "--" (car keys)))
+                  (pop keys)))
+        (key (mapconcat 'identity keys ".")))
     (equal (if magit--refresh-cache
                (car (last (magit-config-get-from-cached-list key)))
-             (magit-git-str "config" "--bool" key))
+             (magit-git-str "config" arg "--bool" key))
            "true")))
 
 (defun magit-set (value &rest keys)



reply via email to

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