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).
This commit is contained in:
Dmitry Gutov 2021-10-11 16:37:55 +03:00
parent 36a485a1af
commit 4afff515c8

View file

@ -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."