Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions dvc/repo/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,12 @@ def copytree(self, top, dest):

for root, _, files in self.walk(top):
root = PathInfo(root)
makedirs(dest, exist_ok=True)
dest_dir = dest / root.relative_to(top)
makedirs(dest_dir, exist_ok=True)
for fname in files:
src = root / fname
with self.open(src, mode="rb") as fobj:
copy_fobj_to_file(fobj, dest / fname)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dest here was the top level destination path, rather than the expected relative path

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I should not have removed that without thinking once. My bad.

copy_fobj_to_file(fobj, dest_dir / fname)

@property
def hash_jobs(self):
Expand Down
4 changes: 3 additions & 1 deletion tests/func/test_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ def test_get_git_dir(tmp_dir, erepo):
src = "some_directory"
dst = "some_directory_imported"

erepo.scm_gen({src: {"file.txt": "hello"}}, commit="add a regular dir")
erepo.scm_gen(
{src: {"dir": {"file.txt": "hello"}}}, commit="add a regular dir"
)

Repo.get(os.fspath(erepo), src, dst)

Expand Down