mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-06 07:18:28 +01:00
working tree: adjust walk behaviour to os.walk
This commit is contained in:
+1
-1
@@ -73,7 +73,7 @@ class WorkingTree(BaseTree):
|
||||
raise e
|
||||
|
||||
for root, dirs, files in dvc_walk(
|
||||
os.path.abspath(top), dvcignore, topdown=topdown, onerror=onerror
|
||||
top, dvcignore, topdown=topdown, onerror=onerror
|
||||
):
|
||||
yield os.path.normpath(root), dirs, files
|
||||
|
||||
|
||||
+5
-25
@@ -129,13 +129,7 @@ class TestWalkInNoSCM(AssertWalkEqualMixin, TestDir):
|
||||
tree = CleanTree(WorkingTree(self._root_dir))
|
||||
self.assertWalkEqual(
|
||||
tree.walk(join("data_dir", "data_sub_dir")),
|
||||
[
|
||||
(
|
||||
join(self._root_dir, "data_dir", "data_sub_dir"),
|
||||
[],
|
||||
["data_sub"],
|
||||
)
|
||||
],
|
||||
[(join("data_dir", "data_sub_dir"), [], ["data_sub"])],
|
||||
)
|
||||
|
||||
|
||||
@@ -145,28 +139,14 @@ class TestWalkInGit(AssertWalkEqualMixin, TestGit):
|
||||
self.assertWalkEqual(
|
||||
tree.walk("."),
|
||||
[
|
||||
(
|
||||
self._root_dir,
|
||||
["data_dir"],
|
||||
["bar", "тест", "code.py", "foo"],
|
||||
),
|
||||
(join(self._root_dir, "data_dir"), ["data_sub_dir"], ["data"]),
|
||||
(
|
||||
join(self._root_dir, "data_dir", "data_sub_dir"),
|
||||
[],
|
||||
["data_sub"],
|
||||
),
|
||||
(".", ["data_dir"], ["bar", "тест", "code.py", "foo"]),
|
||||
(join("data_dir"), ["data_sub_dir"], ["data"]),
|
||||
(join("data_dir", "data_sub_dir"), [], ["data_sub"]),
|
||||
],
|
||||
)
|
||||
self.assertWalkEqual(
|
||||
tree.walk(join("data_dir", "data_sub_dir")),
|
||||
[
|
||||
(
|
||||
join(self._root_dir, "data_dir", "data_sub_dir"),
|
||||
[],
|
||||
["data_sub"],
|
||||
)
|
||||
],
|
||||
[(join("data_dir", "data_sub_dir"), [], ["data_sub"])],
|
||||
)
|
||||
|
||||
def test_branch(self):
|
||||
|
||||
Reference in New Issue
Block a user