branch: elpa/git-commit
commit f53148a569191bdbfb78d76f28481b91c60cb846
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    magit-unstage-all: Don't prompt if there is nothing to unstage
    
    Instead error out.
    
    Closes #4513.
---
 lisp/magit-apply.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/magit-apply.el b/lisp/magit-apply.el
index fcd7792..4e7ee00 100644
--- a/lisp/magit-apply.el
+++ b/lisp/magit-apply.el
@@ -449,6 +449,8 @@ without requiring confirmation."
 (defun magit-unstage-all ()
   "Remove all changes from the staging area."
   (interactive)
+  (unless (magit-anything-staged-p)
+    (user-error "Nothing to unstage"))
   (when (or (magit-anything-unstaged-p)
             (magit-untracked-files))
     (magit-confirm 'unstage-all-changes))

Reply via email to