Skip to content

Commit

Permalink
repofs: only use dvcfs when --dvc-only is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
skshetry authored and efiop committed Apr 29, 2022
1 parent c81d841 commit b71ea34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dvc/fs/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def isdvc(self, path, **kwargs):
_, _, dvc_fs, dvc_path = self._get_fs_pair(path)
return dvc_fs is not None and dvc_fs.isdvc(dvc_path, **kwargs)

def ls(self, path, detail=True, **kwargs):
def ls(self, path, detail=True, dvc_only=False, **kwargs):
fs, fs_path, dvc_fs, dvc_path = self._get_fs_pair(path)

repo = dvc_fs.repo if dvc_fs else self.repo
Expand All @@ -325,7 +325,7 @@ def ls(self, path, detail=True, **kwargs):
for entry in dvc_fs.ls(dvc_path, detail=False):
names.add(dvc_fs.path.name(entry))

if fs:
if not dvc_only and fs:
try:
for entry in dvcignore.ls(
fs, fs_path, detail=False, ignore_subrepos=ignore_subrepos
Expand Down
4 changes: 3 additions & 1 deletion dvc/repo/ls.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ def _ls(fs, path, recursive=None, dvc_only=False):
return {}

infos = {}
for root, dirs, files in fs.walk(fs_path, dvcfiles=True):
for root, dirs, files in fs.walk(
fs_path, dvcfiles=True, dvc_only=dvc_only
):
entries = chain(files, dirs) if not recursive else files

for entry in entries:
Expand Down

0 comments on commit b71ea34

Please sign in to comment.