[patch] Mount custom directory via sshfs
Patch 0001-Allow-custom-path-mounting-for-sshfs.patch
At present, there is no way of setting remote.url
to a value
that allows mounting a specific path over sshfs -- at least not given the way the code is handling ssh://
URLs.
It appears that the script was attempting to allow URLs with a colon
present to pass through unmodified, so someone could specify a custom
directory to found, such as ssh://host.example.com:/path/on/remote
.
However, the regex check for URLs was testing for .*:"
(eg colon, double quote) within a protocol-stripped URL (which
it has been at this point in the code, being
host.example.com:/path/on/remote
). Given how the later sshfs
line
is called (wraps $FINAL_REMOTE_URL in double quotes), then this would never end up working when the URL is passed to sshfs.
This patch change simplifies the regex match for stripped URLs to just a .*:
(colon character somewhere). If schnapps detects a URL that's
been passed to it like the first example above, with a path specified, it will be called like so:
sshfs host.example.com:/path/on/remote /mnt/.remote-snapshots
and correctly mount the specified directory.
Given how the original code was written, it seems like this might have just been a typo having the double-quote character there.
(I would send a merge request, but I'm not allowed to fork the repo)