From: Dmitry Gutov Date: Tue, 7 Sep 2021 23:33:24 +0000 (+0300) Subject: Have Git backend actions accept nil filenames again X-Git-Tag: emacs-28.0.90~1114 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ff2c4a8353b93fe02501e3c51d18963ec75e3b7b;p=emacs.git Have Git backend actions accept nil filenames again * lisp/vc/vc-git.el (vc-git--literal-pathspec): Move the nil check to the beginning (bug#50422). --- diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 037fbcbc48d..5835b5b92be 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -245,11 +245,12 @@ included in the completions." (defun vc-git--literal-pathspec (file) "Prepend :(literal) path magic to FILE." ;; Good example of file name that needs this: "test[56].xx". - (let ((lname (file-local-name file))) - ;; Expand abbreviated file names. - (when (file-name-absolute-p lname) - (setq lname (expand-file-name lname))) - (and file (concat ":(literal)" lname)))) + (when file + (let ((lname (file-local-name file))) + ;; Expand abbreviated file names. + (when (file-name-absolute-p lname) + (setq lname (expand-file-name lname))) + (concat ":(literal)" lname)))) (defun vc-git--literal-pathspecs (files) "Prepend :(literal) path magic to FILES."