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

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

[nongnu] elpa/git-commit 34365a2c5c 03/10: magit-commit-assert: Use --al


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 34365a2c5c 03/10: magit-commit-assert: Use --all instead of explicitly staging all
Date: Tue, 7 Jun 2022 10:58:25 -0400 (EDT)

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

    magit-commit-assert: Use --all instead of explicitly staging all
    
    If the user aborts while writing the message, it is better if the
    state remains the same as before the commit command was invoked.
---
 lisp/magit-commit.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/magit-commit.el b/lisp/magit-commit.el
index 0ccc9fb8d2..cf647d5e9b 100644
--- a/lisp/magit-commit.el
+++ b/lisp/magit-commit.el
@@ -372,9 +372,10 @@ depending on the value of option 
`magit-commit-squash-confirm'."
     (when (eq magit-commit-ask-to-stage 'verbose)
       (magit-diff-unstaged))
     (prog1 (when (or (eq magit-commit-ask-to-stage 'stage)
-                     (y-or-n-p "Nothing staged.  Stage and commit all unstaged 
changes? "))
-             (magit-run-git "add" "-u" ".")
-             (or args (list "--")))
+                     (y-or-n-p
+                      "Nothing staged.  Commit all uncommitted changes? "))
+             (setq this-command 'magit-commit--all)
+             (cons "--all" (or args (list "--"))))
       (when (and (eq magit-commit-ask-to-stage 'verbose)
                  (derived-mode-p 'magit-diff-mode))
         (magit-mode-bury-buffer))))



reply via email to

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