mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-26 23:09:35 +01:00
add: reduce os.fspath calls on recursive (#6287)
This commit is contained in:
+7
-6
@@ -223,13 +223,14 @@ def _find_all_targets(
|
||||
from dvc.dvcfile import is_dvc_file
|
||||
|
||||
if os.path.isdir(target) and recursive:
|
||||
files = map(os.fspath, repo.dvcignore.walk_files(repo.fs, target))
|
||||
yield from (
|
||||
os.fspath(path)
|
||||
for path in repo.dvcignore.walk_files(repo.fs, target)
|
||||
if not repo.is_dvc_internal(os.fspath(path))
|
||||
if not is_dvc_file(os.fspath(path))
|
||||
if not repo.scm.belongs_to_scm(os.fspath(path))
|
||||
if not repo.scm.is_tracked(os.fspath(path))
|
||||
path
|
||||
for path in files
|
||||
if not repo.is_dvc_internal(path)
|
||||
if not is_dvc_file(path)
|
||||
if not repo.scm.belongs_to_scm(path)
|
||||
if not repo.scm.is_tracked(path)
|
||||
)
|
||||
else:
|
||||
yield target
|
||||
|
||||
Reference in New Issue
Block a user