emacs-diffs
[Top][All Lists]
Advanced

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

master 23c20c3: Don't have vc-git-stash-list bug out on the .git directo


From: Lars Ingebrigtsen
Subject: master 23c20c3: Don't have vc-git-stash-list bug out on the .git directory
Date: Sun, 20 Sep 2020 06:13:04 -0400 (EDT)

branch: master
commit 23c20c39683766525d17da52482dfad85b943f48
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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).
---
 lisp/vc/vc-git.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 84aeb0a..6ff6951 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



reply via email to

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