Skip to content

Commit

Permalink
odb: compare abspath to abspath in path_to_oid
Browse files Browse the repository at this point in the history
  • Loading branch information
pmrowla committed Jul 18, 2023
1 parent 76c3665 commit c76ad54
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/dvc_objects/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,11 @@ def _list_prefixes(
yield from self.fs.find(paths, batch_size=jobs, prefix=prefix)

def path_to_oid(self, path) -> str:
self_parts = self.fs.path.parts(self.path)
if self.fs.path.isabs(path):
self_path = self.fs.path.abspath(self.path)
else:
self_path = self.path
self_parts = self.fs.path.parts(self_path)
parts = self.fs.path.parts(path)[len(self_parts) :]

if not (len(parts) == 2 and parts[0] and len(parts[0]) == 2):
Expand Down

0 comments on commit c76ad54

Please sign in to comment.