Don't have vc-git-stash-list bug out on the .git directory

* lisp/vc/vc-git.el (vc-git-stash-list): Don't bug out when
running on the .git directory itself (bug#39285).
This commit is contained in:
Dmitry Gutov 2020-09-20 12:12:36 +02:00 committed by Lars Ingebrigtsen
parent db6bdef2dd
commit 23c20c3968

View file

@ -1707,12 +1707,13 @@ This command shares argument histories with \\[rgrep] and \\[grep]."
(vc-resynch-buffer (vc-git-root default-directory) t t))
(defun vc-git-stash-list ()
(delete
""
(split-string
(replace-regexp-in-string
"^stash@" " " (vc-git--run-command-string nil "stash" "list"))
"\n")))
(when-let ((out (vc-git--run-command-string nil "stash" "list")))
(delete
""
(split-string
(replace-regexp-in-string
"^stash@" " " out)
"\n"))))
(defun vc-git-stash-get-at-point (point)
(save-excursion