Function: magit-convert-filename-for-git
magit-convert-filename-for-git is a byte-compiled function defined in
magit-git.el.
Signature
(magit-convert-filename-for-git FILENAME)
Documentation
Convert FILENAME so that it can be passed to git.
1. If it is a absolute filename, then pass it through
expand-file-name to replace things such as "~/" that
Git does not understand.
2. If it is a remote filename, then remove the remote part.
3. Deal with an windows-nt Emacs vs. Cygwin Git incompatibility.
Source Code
;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-git.el
(defun magit-convert-filename-for-git (filename)
"Convert FILENAME so that it can be passed to git.
1. If it is a absolute filename, then pass it through
`expand-file-name' to replace things such as \"~/\" that
Git does not understand.
2. If it is a remote filename, then remove the remote part.
3. Deal with an `windows-nt' Emacs vs. Cygwin Git incompatibility."
(cond-let
((not (file-name-absolute-p filename))
filename)
([cyg:win (cl-rassoc filename magit-cygwin-mount-points
:test (##string-prefix-p %2 %1))]
(concat (car cyg:win)
(substring filename (length (cdr cyg:win)))))
([expanded (expand-file-name filename)]
(or (file-remote-p expanded 'localname)
expanded))))