aboutsummaryrefslogtreecommitdiff
path: root/lisp/magit-commit.el
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2023-02-11 00:23:50 +0100
committerJonas Bernoulli <jonas@bernoul.li>2023-02-11 00:23:50 +0100
commit467bb21f7d773433a50ac6a89087b6c2b41ab86d (patch)
treea3122fa166eafbcedd14f541dd36c48a01fc831f /lisp/magit-commit.el
parent6d325d90ba1374d48c4c7088f96864b678155f48 (diff)
magit-commit-diff-1: Take --allow-empty into account
Diffstat (limited to 'lisp/magit-commit.el')
-rw-r--r--lisp/magit-commit.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/magit-commit.el b/lisp/magit-commit.el
index a053927..247a177 100644
--- a/lisp/magit-commit.el
+++ b/lisp/magit-commit.el
@@ -180,8 +180,10 @@ With a prefix argument, amend to the commit at `HEAD' instead.
(interactive (if current-prefix-arg
(list (cons "--amend" (magit-commit-arguments)))
(list (magit-commit-arguments))))
- (when (member "--all" args)
- (setq this-command 'magit-commit--all))
+ (cond ((member "--all" args)
+ (setq this-command 'magit-commit--all))
+ ((member "--allow-empty" args)
+ (setq this-command 'magit-commit--allow-empty)))
(when (setq args (magit-commit-assert args))
(let ((default-directory (magit-toplevel)))
(magit-run-git-with-editor "commit" args))))
@@ -585,6 +587,9 @@ See `magit-commit-absorb' for an alternative implementation."
(setq rev (format "HEAD~%s" squash)))
(`(,_ ,_ magit-commit-amend)
(setq rev "HEAD^"))
+ (`(nil nil magit-commit--allow-empty)
+ (setq rev "HEAD")
+ (setq arg nil))
((or `(,_ ,_ magit-commit-reword)
`(nil nil ,_))
(setq rev "HEAD^..HEAD")