Skip to content

Commit 27b0907

Browse files
committed
ls: don't use outs
ls doesn't support subrepos, so we can simply use dvcfs in --dvc-only.
1 parent 48641fb commit 27b0907

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

dvc/repo/ls.py

Lines changed: 11 additions & 12 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.repo_fs
53+
fs = repo.dvcfs if dvc_only else repo.repo_fs
5454
infos = []
5555
try:
5656
for root, dirs, files in fs.walk(
@@ -73,15 +73,14 @@ def onerror(exc):
7373
# broken symlink
7474
_info = {"type": "file", "isexec": False}
7575

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-
}
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+
}
8786
return ret

0 commit comments

Comments
 (0)