Skip to content

Result inconsistency for __call__, is_ignored_file and is_ignored_dir #4333

@karajan1001

Description

@karajan1001

Bug Report

Please provide information about your setup

Output of dvc version:

$ dvc version

master

Additional Information (if any):

If applicable, please also provide a --verbose output of the command, eg: dvc add --verbose.

Now there are several interfaces for the dvcignore.
In is_ignored_dir we ignored all paths outside the repo.
https://github.com/iterative/dvc/blob/35dd1fda9cfb4b645ae431f4621f2d1853d4fb7c/dvc/ignore.py#L270-L272
In a direct call __call__ all outside paths are included.
https://github.com/iterative/dvc/blob/35dd1fda9cfb4b645ae431f4621f2d1853d4fb7c/dvc/ignore.py#L241-L244
And in is_ignored_files there is a bug that makes us skipped "outside the repo" check and return False forever.
https://github.com/iterative/dvc/blob/35dd1fda9cfb4b645ae431f4621f2d1853d4fb7c/dvc/ignore.py#L275-L278

They should be unified. So in what condition do we need to mask files outside the repo? And should we put this logic in dvcignore?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugDid we break something?help wantedp2-mediumMedium priority, should be done, but less important

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions