aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2026-03-21 10:47:48 +0100
committerJonas Bernoulli <jonas@bernoul.li>2026-03-21 10:47:48 +0100
commit8d891f7c41f03aaa995d21fdcff8101d4568712f (patch)
treee1ac2738341380c882e06f5d496cd3a15d484d90
parent1ddb6f103669eca22f336cb1f64ee38714b85631 (diff)
transient--git-variable-list-choices: Use value from value slot
It's the responsibility of `transient-init-value' to determine the value, and it does, so use that. The condition used when setting the local `global' variable is correct. Then the `global' slot is non-nil, then the value of the `value' slot is that global value, and there is no "more global" value.
-rw-r--r--lisp/magit-transient.el10
1 files changed, 3 insertions, 7 deletions
diff --git a/lisp/magit-transient.el b/lisp/magit-transient.el
index f9fb4b0..c88dc4b 100644
--- a/lisp/magit-transient.el
+++ b/lisp/magit-transient.el
@@ -193,19 +193,15 @@
(defun magit--git-variable-list-choices (obj)
(let* ((variable (oref obj variable))
(choices (oref obj choices))
- (globalp (oref obj global))
- (value nil)
- (global (magit-git-string "config" "--global" variable))
+ (value (oref obj value))
+ (global (and (not (oref obj global))
+ (magit-git-string "config" "--global" variable)))
(defaultp (oref obj default))
(default (if (functionp defaultp) (funcall defaultp obj) defaultp))
(fallback (oref obj fallback))
(fallback (and fallback
(and$ (magit-get fallback)
(concat fallback ":" $)))))
- (if (not globalp)
- (setq value (magit-git-string "config" "--local" variable))
- (setq value global)
- (setq global nil))
(when (functionp choices)
(setq choices (funcall choices)))
(cons (cond (global