branch: elpa/git-commit
commit fa620ed3e45b08c45466f9930e348bf957c27e66
Author: Shuguang Sun <shuguan...@qq.com>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    magit-convert-filename-for-git: Fix for Tramp in Windows
    
    For Tramp in Windows, expanding the file name first before to get
    the local name.  Otherwise "c:" will be added to the filename.
    
    For example, "/plink:user@host:~/R/" should be converted as
    "/home/R/" and not "c:/home/R/"
---
 lisp/magit-git.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index d231580..f6a2014 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -1028,9 +1028,9 @@ Sorted from longest to shortest CYGWIN name."
                 (cl-rassoc filename magit-cygwin-mount-points
                            :test (lambda (f win) (string-prefix-p win f))))
           (concat cyg (substring filename (length win)))
-        (expand-file-name
-         (or (file-remote-p filename 'localname)
-             filename)))
+        (let ((expanded (expand-file-name filename)))
+          (or (file-remote-p expanded 'localname)
+              expanded)))
     filename))
 
 (defun magit-decode-git-path (path)

Reply via email to