Skip to content

Commit 9b5ccb7

Browse files
committed
Revert "ls: don't use outs"
This reverts commit 27b0907.
1 parent 27b0907 commit 9b5ccb7

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

dvc/repo/ls.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def _ls(repo, fs_path, recursive=None, dvc_only=False):
5050
def onerror(exc):
5151
raise exc
5252

53-
fs = repo.dvcfs if dvc_only else repo.repo_fs
53+
fs = repo.repo_fs
5454
infos = []
5555
try:
5656
for root, dirs, files in fs.walk(
@@ -73,14 +73,15 @@ def onerror(exc):
7373
# broken symlink
7474
_info = {"type": "file", "isexec": False}
7575

76-
path = (
77-
fs.path.name(fs_path)
78-
if fs_path == info
79-
else fs.path.relpath(info, fs_path)
80-
)
81-
ret[path] = {
82-
"isout": _info.get("isout", False),
83-
"isdir": _info["type"] == "directory",
84-
"isexec": _info["isexec"],
85-
}
76+
if _info.get("outs") or not dvc_only:
77+
path = (
78+
fs.path.name(fs_path)
79+
if fs_path == info
80+
else fs.path.relpath(info, fs_path)
81+
)
82+
ret[path] = {
83+
"isout": _info.get("isout", False),
84+
"isdir": _info["type"] == "directory",
85+
"isexec": _info["isexec"],
86+
}
8687
return ret

0 commit comments

Comments
 (0)