Skip to content

Matching for files inside folder does not seem to behave like .gitignore's #95

@carlescufi

Description

@carlescufi

Perhaps I'm doing something wrong, but according to the .gitignore doc:

The pattern foo/*, matches foo/test.json (a regular file), foo/bar (a directory), but it does not match foo/bar/hello.c (a regular file), as the asterisk in the pattern does not match bar/hello.c which has a slash in it.

However, if I try the following:

In [16]: spec = pathspec.GitIgnoreSpec.from_lines(["foo/*"])

In [17]: spec.match_file("foo/bar/hello.c")
Out[17]: True

Am I not using the right spec, or is there something that I am not grasping?

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementTo-DoPlanned feature that needs to be done.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions