From ff2c4a8353b93fe02501e3c51d18963ec75e3b7b Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Wed, 8 Sep 2021 02:33:24 +0300 Subject: [PATCH] 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). --- lisp/vc/vc-git.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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." -- 2.39.2