branch: elpa/git-commit
commit b5c0882a4fe907b09db12a2d87dc3fddf52b264d
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
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)