Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone file adapter lacks Windows UNC path support #5703

Open
chrisd8088 opened this issue Apr 9, 2024 · 1 comment
Open

Standalone file adapter lacks Windows UNC path support #5703

chrisd8088 opened this issue Apr 9, 2024 · 1 comment

Comments

@chrisd8088
Copy link
Contributor

Describe the bug
As reported in discussion #5692, the git-lfs-standalone-file adapter parses input file:// URLs, and then only uses the url.Path element, so file:// URLs corresponding to Windows UNC file paths, where the hostname is parsed into the url.Host element, are unsupported.

To Reproduce
Steps to reproduce the behaviour:

  1. On Windows, attempt a Git clone using a file://<host>/<path> URL corresponding to a Windows UNC path to another host, e.g.:
    $ git clone "file://DESKTOP-D3J67S2/Temas_Git/Repositorio"
    ...
    Error downloading object: Doc_01.txt (e470fa0): Smudge error: Error downloading Doc_01.txt (e470fa0d001e50b3ec3088022462a94ea7c87dd80106411b7d120f90b379e977): error initializing custom adapter "lfs-standalone-file" worker 0: [0] error creating handler: chdir /Temas_Git/Repositorio: El sistema no puede encontrar la ruta especificada.
    

Expected behaviour
The standalone transfer adapter should convert the file://host/path URL into a Windows UNC path and allow the operation to succeed. For instance, file://DESKTOP-D3J67S2/Temas_Git/Repositorio would become \\DESKTOP-D3J67S2\Temas_Git\Repositorio.

System environment
Windows

Output of git lfs env

Endpoint=file://DESKTOP-D3J67S2/Temas_Git/Repositorio (auth=none)
LocalWorkingDir=C:\Users\Japo\Desktop\Clon\Repositorio
LocalGitDir=C:\Users\Japo\Desktop\Clon\Repositorio.git
LocalGitStorageDir=C:\Users\Japo\Desktop\Clon\Repositorio.git
LocalMediaDir=C:\Users\Japo\Desktop\Clon\Repositorio.git\lfs\objects
LocalReferenceDirs=
TempDir=C:\Users\Japo\Desktop\Clon\Repositorio.git\lfs\tmp
ConcurrentTransfers=8
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneRemoteName=origin
LfsStorageDir=C:\Users\Japo\Desktop\Clon\Repositorio.git\lfs
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic,lfs-standalone-file,ssh
UploadTransfers=basic,lfs-standalone-file,ssh
GIT_EXEC_PATH=C:/Program Files/Git/mingw64/libexec/git-core
GIT_TRACE=1
git config filter.lfs.process = "git-lfs filter-process"
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"

Additional context
Conversion of a Windows file:// URL into a UNC path is described in this blog post, as mentioned in golang/go#32456.

To do this, we could borrow Go's implementation from their command-line tools.

@chrisd8088 chrisd8088 added this to Bugs in Backlog Apr 9, 2024
@chrisd8088 chrisd8088 moved this from Bugs to Enhancements in Backlog Apr 9, 2024
@vruss
Copy link

vruss commented May 16, 2024

file:////<host>/<path> seems to work as a workaround for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Backlog
Enhancements
Development

No branches or pull requests

2 participants