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

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

[nongnu] elpa/git-commit 54d37dc14c: magit-branch-read-args: Cosmetics


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 54d37dc14c: magit-branch-read-args: Cosmetics
Date: Thu, 25 Jan 2024 15:59:59 -0500 (EST)

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

    magit-branch-read-args: Cosmetics
---
 lisp/magit-branch.el | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/lisp/magit-branch.el b/lisp/magit-branch.el
index 8472d04d4b..a9fb8525de 100644
--- a/lisp/magit-branch.el
+++ b/lisp/magit-branch.el
@@ -418,22 +418,23 @@ when using `magit-branch-and-checkout'."
 (defun magit-branch-read-args (prompt &optional default-start)
   (if magit-branch-read-upstream-first
       (let ((choice (magit-read-starting-point prompt nil default-start)))
-        (if (magit-rev-verify choice)
-            (list (magit-read-string-ns
-                   (if magit-completing-read--silent-default
-                       (format "%s (starting at `%s')" prompt choice)
-                     "Name for new branch")
-                   (let ((def (mapconcat #'identity
-                                         (cdr (split-string choice "/"))
-                                         "/")))
-                     (and (member choice (magit-list-remote-branch-names))
-                          (not (member def (magit-list-local-branch-names)))
-                          def)))
-                  choice)
-          (if (eq magit-branch-read-upstream-first 'fallback)
-              (list choice
-                    (magit-read-starting-point prompt choice default-start))
-            (user-error "Not a valid starting-point: %s" choice))))
+        (cond
+         ((magit-rev-verify choice)
+          (list (magit-read-string-ns
+                 (if magit-completing-read--silent-default
+                     (format "%s (starting at `%s')" prompt choice)
+                   "Name for new branch")
+                 (let ((def (mapconcat #'identity
+                                       (cdr (split-string choice "/"))
+                                       "/")))
+                   (and (member choice (magit-list-remote-branch-names))
+                        (not (member def (magit-list-local-branch-names)))
+                        def)))
+                choice))
+         ((eq magit-branch-read-upstream-first 'fallback)
+          (list choice
+                (magit-read-starting-point prompt choice default-start)))
+         ((user-error "Not a valid starting-point: %s" choice))))
     (let ((branch (magit-read-string-ns (concat prompt " named"))))
       (if (magit-branch-p branch)
           (magit-branch-read-args



reply via email to

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