Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repofs: only use dvcfs when --dvc-only is specified #7659

Merged
merged 1 commit into from
Apr 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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