emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master df56142: * lisp/vc/vc-git.el (vc-git-stash): Call v


From: Juri Linkov
Subject: [Emacs-diffs] master df56142: * lisp/vc/vc-git.el (vc-git-stash): Call vc-dir-marked-files only
Date: Mon, 3 Dec 2018 19:15:49 -0500 (EST)

branch: master
commit df5614297b6d4ca8a3c9cd18fea5088401b25146
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>

    * lisp/vc/vc-git.el (vc-git-stash): Call vc-dir-marked-files only
    
    in vc-dir-mode.
---
 lisp/vc/vc-git.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index e406660..f317400 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1475,12 +1475,16 @@ This command shares argument histories with \\[rgrep] 
and \\[grep]."
        (if (eq next-error-last-buffer (current-buffer))
            (setq default-directory dir))))))
 
+(autoload 'vc-dir-marked-files "vc-dir")
+
 (defun vc-git-stash (name)
   "Create a stash."
   (interactive "sStash name: ")
   (let ((root (vc-git-root default-directory)))
     (when root
-      (apply #'vc-git--call nil "stash" "push" "-m" name (vc-dir-marked-files))
+      (apply #'vc-git--call nil "stash" "push" "-m" name
+             (when (derived-mode-p 'vc-dir-mode)
+               (vc-dir-marked-files)))
       (vc-resynch-buffer root t t))))
 
 (defvar vc-git-stash-read-history nil



reply via email to

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