From: Dmitry Gutov Date: Fri, 26 Nov 2021 13:03:30 +0000 (+0300) Subject: Remove empty lines from stash read prompt X-Git-Tag: emacs-29.0.90~2852^2~21 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=824d31e3bf22d57bc8f8011e6719b15059bea55b;p=emacs.git Remove empty lines from stash read prompt * lisp/vc/vc-git.el (vc-git-stash-read): Pass OMIT-NULLS (bug#52119). (vc-git-stash-list): Simplify. --- diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 2d35061b269..4b6cd930744 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1688,7 +1688,7 @@ This command shares argument histories with \\[rgrep] and \\[grep]." (let ((stash (completing-read prompt (split-string - (or (vc-git--run-command-string nil "stash" "list") "") "\n") + (or (vc-git--run-command-string nil "stash" "list") "") "\n" t) nil :require-match nil 'vc-git-stash-read-history))) (if (string-equal stash "") (user-error "Not a stash") @@ -1733,12 +1733,11 @@ This command shares argument histories with \\[rgrep] and \\[grep]." (defun vc-git-stash-list () (when-let ((out (vc-git--run-command-string nil "stash" "list"))) - (delete - "" - (split-string - (replace-regexp-in-string - "^stash@" " " out) - "\n")))) + (split-string + (replace-regexp-in-string + "^stash@" " " out) + "\n" + t))) (defun vc-git-stash-get-at-point (point) (save-excursion