-
Notifications
You must be signed in to change notification settings - Fork 14
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
gitfs: better comply with fsspec #56
Conversation
if relparts == ["."]: | ||
return () | ||
relparts = path.split(self.sep) | ||
if relparts and relparts[0] in (".", ""): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better to normalize the path beforehand, but our fs.path
is not yet available in fsspec, so we'll get to it later.
This PR makes our fs accept paths relative to the root of the repo and using / as a separator. Previous behaviour was a legacy from old dvc. Pre-requisite for making dvcfs/repofs/etc switch to the same relative repo paths and / separators.
fsspec filesystems don't yet have a notion of cwd, so "." should not be used. Instead, we should support using fs.root_marker ("" in our case), which is currently broken.
@@ -20,6 +20,124 @@ | |||
from scmrepo.git.objects import GitTrie | |||
|
|||
|
|||
class Path: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Temporary copy from dvc/fs/path.py until we get it into fsspec. Useful for handling chdirs.
Closes #40