summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2020-09-20 12:12:36 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2020-09-20 12:12:41 +0200
commit23c20c39683766525d17da52482dfad85b943f48 (patch)
treed9d3e25b0b2a26e89f47f95536b08ff10ebc2fb4 /lisp
parentdb6bdef2dd6abe2f2d1e8c49f0d86a490a63d81b (diff)
downloademacs-23c20c39683766525d17da52482dfad85b943f48.tar.gz
emacs-23c20c39683766525d17da52482dfad85b943f48.tar.bz2
emacs-23c20c39683766525d17da52482dfad85b943f48.zip
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).
Diffstat (limited to 'lisp')
-rw-r--r--lisp/vc/vc-git.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 84aeb0a1105..6ff6951dbc9 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -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