branch: elpa/magit
commit 4e2dd7ba6f54b2251a702b4c0416467d7315407a
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>

    magit-completing-read-multiple: Support requiring non-empty input
    
    In [1: c52abfd66e] `magit-completing-read' learned to interpret `any'
    for REQUIRE-MATCH accordingly, but `magit-completing-read-multiple'
    did not.  Never-the-less callers of both functions were changed to
    use `any'.
    
    Closes #5422.
    
    1: 2025-08-01 c52abfd66e863ff34fea13e93f83280e5051d843
       magit-completing-read: Support requiring non-empty input
---
 lisp/magit-base.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/magit-base.el b/lisp/magit-base.el
index cce9ded1422..5a502edf6c7 100644
--- a/lisp/magit-base.el
+++ b/lisp/magit-base.el
@@ -702,8 +702,11 @@ third-party completion frameworks."
        ;; And now, the moment we have all been waiting for...
        (values (completing-read-multiple
                 (magit--format-prompt prompt def)
-                table predicate require-match initial-input
-                hist def inherit-input-method)))
+                table predicate
+                (if (eq require-match 'any) nil require-match)
+                initial-input hist def inherit-input-method)))
+    (when (and require-match (not values))
+      (user-error "Nothing selected"))
     (if no-split input values)))
 
 (defvar-keymap magit-minibuffer-local-ns-map

Reply via email to