Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions dvc/repo/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,17 @@ def _granular_diff(
from dvc_data.diff import diff as odiff
from dvc_data.objects.tree import Tree

drop_root = False
trees = isinstance(old_obj, Tree) or isinstance(new_obj, Tree)
if trees:
drop_root = not with_dirs

def path_join(root: str, *paths: str) -> str:
if not isinstance(new_obj, Tree):
if not trees and paths == ROOT:
return root
return os.path.sep.join([root, *paths])

diff_data = odiff(old_obj, new_obj, cache)
drop_root = not with_dirs and isinstance(new_obj, Tree)

output: Dict[str, List[str]] = defaultdict(list)
for state in ("added", "deleted", "modified", "unchanged"):
Expand Down