aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2021-08-31 02:47:31 +0300
committerDmitry Gutov2021-08-31 02:47:31 +0300
commitd2ad64b7a524450bd1a4f59a5e0801abb0637b32 (patch)
tree8820e446a210eaf1b01d3c1485d9ef421b412da5
parenta1887cc5e6c63d89f8495148d32a6927f84f1571 (diff)
downloademacs-d2ad64b7a524450bd1a4f59a5e0801abb0637b32.tar.gz
emacs-d2ad64b7a524450bd1a4f59a5e0801abb0637b32.zip
Move the expansion of abbreviated names to vc-git.el
* lisp/vc/vc-git.el (vc-git--literal-pathspec): Perform the expansion of abbreviated file names here instead (bug#39452). * lisp/vc/vc.el (vc-root-diff, vc-print-root-log): Undo the recent change.
-rw-r--r--lisp/vc/vc-git.el6
-rw-r--r--lisp/vc/vc.el10
2 files changed, 10 insertions, 6 deletions
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 1cd200cd134..a5431abb40c 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -245,7 +245,11 @@ included in the completions."
245(defun vc-git--literal-pathspec (file) 245(defun vc-git--literal-pathspec (file)
246 "Prepend :(literal) path magic to FILE." 246 "Prepend :(literal) path magic to FILE."
247 ;; Good example of file name that needs this: "test[56].xx". 247 ;; Good example of file name that needs this: "test[56].xx".
248 (and file (concat ":(literal)" (file-local-name file)))) 248 (let ((lname (file-local-name file)))
249 ;; Expand abbreviated file names.
250 (when (file-name-absolute-p lname)
251 (setq lname (expand-file-name lname)))
252 (and file (concat ":(literal)" lname))))
249 253
250(defun vc-git--literal-pathspecs (files) 254(defun vc-git--literal-pathspecs (files)
251 "Prepend :(literal) path magic to FILES." 255 "Prepend :(literal) path magic to FILES."
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 38204ef91c8..8036be390a9 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -2055,9 +2055,9 @@ saving the buffer."
2055 ;; here, this way the *vc-diff* buffer is setup correctly, so 2055 ;; here, this way the *vc-diff* buffer is setup correctly, so
2056 ;; relative file names work. 2056 ;; relative file names work.
2057 (let ((default-directory rootdir)) 2057 (let ((default-directory rootdir))
2058 (vc-diff-internal 2058 (vc-diff-internal
2059 t (list backend (list (expand-file-name rootdir)) working-revision) nil nil 2059 t (list backend (list rootdir) working-revision) nil nil
2060 (called-interactively-p 'interactive)))))) 2060 (called-interactively-p 'interactive))))))
2061 2061
2062;;;###autoload 2062;;;###autoload
2063(defun vc-root-dir () 2063(defun vc-root-dir ()
@@ -2603,8 +2603,8 @@ with its diffs (if the underlying VCS supports that)."
2603 (setq backend (vc-responsible-backend rootdir)) 2603 (setq backend (vc-responsible-backend rootdir))
2604 (unless backend 2604 (unless backend
2605 (error "Directory is not version controlled"))) 2605 (error "Directory is not version controlled")))
2606 (setq default-directory (expand-file-name rootdir)) 2606 (setq default-directory rootdir)
2607 (vc-print-log-internal backend (list default-directory) revision revision limit 2607 (vc-print-log-internal backend (list rootdir) revision revision limit
2608 (when with-diff 'with-diff)))) 2608 (when with-diff 'with-diff))))
2609 2609
2610;;;###autoload 2610;;;###autoload