f8de4cc7fe
Currently, we only support local remotes using file URLs, but not local paths. This is a highly requested feature, however, so implement support for local paths as remotes. First, fix the handling of local paths we already have: the handling of absolute Unix-style paths. Instead of checking for the remote to contain a file URL to determine whether to append "info/lfs" to the URL, look to see if the URL we're using is a file URL, which will catch local paths which will have been rewritten as such by this point. The "info/lfs" part of the URL is not handled by the transfer adapter, so we don't want to add it on. If we get something that looks like it's not a URL, check if it's a file on the file system, and if so, don't attempt to interpret it as an SSH URL. This fixes the confusion with Windows paths, which resemble SSH-style locations with a single-letter alias as the host name. Finally, when turning a local path into a file URL, turn the path into an absolute one if possible and rewrite it using slashes, which is required for file URLs. Add several tests for the various cases: one for Unix-style paths, one for native paths, and one for relative paths. |
||
---|---|---|
.. | ||
standalone | ||
body.go | ||
certs_darwin.go | ||
certs_dragonfly.go | ||
certs_freebsd.go | ||
certs_linux.go | ||
certs_openbsd.go | ||
certs_test.go | ||
certs_windows.go | ||
certs.go | ||
client_test.go | ||
client.go | ||
cookies.go | ||
endpoint.go | ||
errors.go | ||
lfshttp.go | ||
proxy_test.go | ||
proxy.go | ||
retries_test.go | ||
retries.go | ||
ssh_test.go | ||
ssh.go | ||
stats_test.go | ||
stats.go | ||
verbose_test.go | ||
verbose.go |