aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2026-03-31 22:45:32 +0200
committerJonas Bernoulli <jonas@bernoul.li>2026-03-31 22:45:32 +0200
commit3e54579995cb0a58d57ab2b0a76ea0f5cbf656cc (patch)
tree734bf993078401d1e2ec6a27c7891e1b443ab3d5
parent1c0efafc4b4ceaabe53099d2addb2ca4a0090de6 (diff)
magit-gitignore-on-system: Make only inapt if variable is unset
-rw-r--r--lisp/magit-gitignore.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/magit-gitignore.el b/lisp/magit-gitignore.el
index 4546ba7..942f3b1 100644
--- a/lisp/magit-gitignore.el
+++ b/lisp/magit-gitignore.el
@@ -87,9 +87,10 @@ Rules in that file only affects this clone of the repository."
(transient-define-suffix magit-gitignore-on-system (rule)
"Add the Git ignore RULE to the file specified by `core.excludesFile'.
Rules that are defined in that file affect all local repositories."
- :if (##magit-get "core.excludesfile")
+ :inapt-if-not (##magit-get "core.excludesfile")
:description (##format "privately for all repositories (%s)"
- (magit-get "core.excludesfile"))
+ (or (magit-get "core.excludesfile")
+ "core.excludesfile is not set"))
(interactive (list (magit-gitignore-read-pattern)))
(magit--gitignore rule
(or (magit-get "core.excludesFile")