branch: elpa/magit
commit 542c2f8a75de5a6591064c6176ccf69b75064df4
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
magit-dired-{stage,unstage}: New commands
---
lisp/magit-dired.el | 12 ++++++++++++
lisp/magit-files.el | 6 ++++--
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/lisp/magit-dired.el b/lisp/magit-dired.el
index 084ccd58a0e..e980707462d 100644
--- a/lisp/magit-dired.el
+++ b/lisp/magit-dired.el
@@ -47,6 +47,18 @@ is no file at point, then instead visit `default-directory'."
;;; Commands for Dired Buffers
+;;;###autoload
+(defun magit-dired-stage ()
+ "In Dired, staged all marked files or the file at point."
+ (interactive)
+ (magit-stage-files (dired-get-marked-files)))
+
+;;;###autoload
+(defun magit-dired-unstage ()
+ "In Dired, unstaged all marked files or the file at point."
+ (interactive)
+ (magit-unstage-files (dired-get-marked-files)))
+
;;;###autoload
(defun magit-dired-log (&optional follow)
"Show log for all marked files, or the current file."
diff --git a/lisp/magit-files.el b/lisp/magit-files.el
index 21cc5e81e87..a0088ea58ce 100644
--- a/lisp/magit-files.el
+++ b/lisp/magit-files.el
@@ -300,8 +300,10 @@ to `magit-dispatch'."
:info-manual "(magit) Minor Mode for Buffers Visiting Files"
[:if magit-file-relative-name
["File actions"
- (" s" "Stage" magit-file-stage)
- (" u" "Unstage" magit-file-unstage)
+ (" s" "Stage" magit-file-stage :if-not-derived dired-mode)
+ (" s" "Stage" magit-dired-stage :if-derived dired-mode)
+ (" u" "Unstage" magit-file-unstage :if-not-derived dired-mode)
+ (" u" "Unstage" magit-dired-unstage :if-derived dired-mode)
(", x" "Untrack" magit-file-untrack)
(", r" "Rename" magit-file-rename)
(", k" "Delete" magit-file-delete)