tree: walk: operate on tree absolute root

This commit is contained in:
pared
2019-04-23 02:38:23 +03:00
committed by Ruslan Kuprieiev
parent 8ef52f92ee
commit dd8598e53e
4 changed files with 84 additions and 19 deletions
+2 -2
View File
@@ -109,7 +109,7 @@ class GitTree(BaseTree):
tree.abspath, ignore_file_handler=ignore_file_handler
)
dirs, nondirs = dvc_ignore_filter(tree.path, dirs, nondirs)
yield os.path.normpath(tree.path), dirs, nondirs
yield os.path.normpath(tree.abspath), dirs, nondirs
for i in dirs:
for x in self._walk(
@@ -121,7 +121,7 @@ class GitTree(BaseTree):
yield x
if not topdown:
yield os.path.normpath(tree.path), dirs, nondirs
yield os.path.normpath(tree.abspath), dirs, nondirs
def walk(self, top, topdown=True, ignore_file_handler=None):
"""Directory tree generator.
+1 -1
View File
@@ -72,7 +72,7 @@ class WorkingTree(BaseTree):
raise e
for root, dirs, files in dvc_walk(
top,
os.path.abspath(top),
topdown=topdown,
onerror=onerror,
ignore_file_handler=ignore_file_handler,