diff options
| author | Dmitry Gutov | 2021-10-11 16:37:55 +0300 |
|---|---|---|
| committer | Dmitry Gutov | 2021-10-11 16:43:55 +0300 |
| commit | 4afff515c870339bdb3fccab4175b063770eb4bf (patch) | |
| tree | 9f6a03c5d6f649fce7bffca767c502b42828778e | |
| parent | 36a485a1afb6b352ddb2d036d5ca430f4c6fdd10 (diff) | |
| download | emacs-4afff515c870339bdb3fccab4175b063770eb4bf.tar.gz emacs-4afff515c870339bdb3fccab4175b063770eb4bf.zip | |
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).
| -rw-r--r-- | lisp/vc/vc-git.el | 11 |
1 files changed, 5 insertions, 6 deletions
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." | |||
| 242 | ;;;###autoload (load "vc-git" nil t) | 242 | ;;;###autoload (load "vc-git" nil t) |
| 243 | ;;;###autoload (vc-git-registered file)))) | 243 | ;;;###autoload (vc-git-registered file)))) |
| 244 | 244 | ||
| 245 | ;; Good example of file name that needs this: "test[56].xx". | ||
| 245 | (defun vc-git--literal-pathspec (file) | 246 | (defun vc-git--literal-pathspec (file) |
| 246 | "Prepend :(literal) path magic to FILE." | 247 | "Prepend :(literal) path magic to FILE." |
| 247 | ;; Good example of file name that needs this: "test[56].xx". | ||
| 248 | (when file | 248 | (when file |
| 249 | (let ((lname (file-local-name file))) | 249 | ;; Expand abbreviated file names. |
| 250 | ;; Expand abbreviated file names. | 250 | (when (file-name-absolute-p file) |
| 251 | (when (file-name-absolute-p lname) | 251 | (setq file (expand-file-name file))) |
| 252 | (setq lname (expand-file-name lname))) | 252 | (concat ":(literal)" (file-local-name file)))) |
| 253 | (concat ":(literal)" lname)))) | ||
| 254 | 253 | ||
| 255 | (defun vc-git--literal-pathspecs (files) | 254 | (defun vc-git--literal-pathspecs (files) |
| 256 | "Prepend :(literal) path magic to FILES." | 255 | "Prepend :(literal) path magic to FILES." |