Skip to content

Git filters don't filter events describing removed directories that are ignored by git. #15

Description

@ttd2089

When a directory is removed, pocket's file watcher will raise an event with REMOVE and the path of the directory; but the fact that the path refers to a directory is not part of the event because it's not available from the underlying filesystem notification APIs.

When a .gitignore file contains an entry that specifically refers to a directory, /dist/ as opposed to /dist, the path will only be ignored when it can be identified definitively as a directory. If the directory exists then the path dist will resolve to the directory, otherwise it needs to specified as dist/ for git-check-ignore know the path is referring to a directory.

As a result of these two facts, the git filter in pocket fails to filter events describing the removal of directories that are listed in the .gitignore as directories because the directory doesn't exist at the time of the check and the path in the event doesn't contain the trailing slash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions