From: Dmitry Gutov Date: Mon, 11 Oct 2021 13:37:55 +0000 (+0300) Subject: Expand the full file name X-Git-Tag: emacs-28.0.90~323 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4afff515c8;p=emacs.git Expand the full file name * lisp/vc/vc-git.el (vc-git--literal-pathspec): Expand the full file name, not just the local part (bug#51112). --- diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index eca8d547a90..35c0838dd6f 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -242,15 +242,14 @@ included in the completions." ;;;###autoload (load "vc-git" nil t) ;;;###autoload (vc-git-registered file)))) +;; Good example of file name that needs this: "test[56].xx". (defun vc-git--literal-pathspec (file) "Prepend :(literal) path magic to FILE." - ;; Good example of file name that needs this: "test[56].xx". (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)))) + ;; Expand abbreviated file names. + (when (file-name-absolute-p file) + (setq file (expand-file-name file))) + (concat ":(literal)" (file-local-name file)))) (defun vc-git--literal-pathspecs (files) "Prepend :(literal) path magic to FILES."