aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2024-10-17 04:02:42 +0200
committerJonas Bernoulli <jonas@bernoul.li>2024-10-17 04:02:42 +0200
commitabb86c6a39fd1b1c8d59fb288f907bb60c6cc11d (patch)
treecbdcb80dd135d6994a9f88880d0b75d66d0e2340
parent06f3ffa868f9aaa4ddeaf65811f315fdb6a4a626 (diff)
magit-commit-squash-internal: Reduce nesting
-rw-r--r--lisp/magit-commit.el13
1 files changed, 6 insertions, 7 deletions
diff --git a/lisp/magit-commit.el b/lisp/magit-commit.el
index be32e0a..b6fb250 100644
--- a/lisp/magit-commit.el
+++ b/lisp/magit-commit.el
@@ -292,13 +292,12 @@ depending on the value of option `magit-commit-squash-confirm'."
(defun magit-commit-squash-internal
(option commit &optional args rebase edit confirmed)
(when-let ((args (magit-commit-assert args (not edit))))
- (when commit
- (when (and rebase (not (magit-rev-ancestor-p commit "HEAD")))
- (magit-read-char-case
- (format "%s isn't an ancestor of HEAD. " commit) nil
- (?c "[c]reate without rebasing" (setq rebase nil))
- (?s "[s]elect other" (setq commit nil))
- (?a "[a]bort" (user-error "Quit")))))
+ (when (and commit rebase (not (magit-rev-ancestor-p commit "HEAD")))
+ (magit-read-char-case
+ (format "%s isn't an ancestor of HEAD. " commit) nil
+ (?c "[c]reate without rebasing" (setq rebase nil))
+ (?s "[s]elect other" (setq commit nil))
+ (?a "[a]bort" (user-error "Quit"))))
(when commit
(setq commit (magit-rebase-interactive-assert commit t)))
(if (and commit