Skip to content

files inside an ignored sub-directory are not matched #19

@spMohanty

Description

@spMohanty

Consider the case of a directory structure like :

.
|-- directoryD
|   |-- fileE
|   `-- fileF
|-- directoryG
|   |-- directoryH
|   |   |-- fileI
|   |   |-- fileJ
|   |   |-- fileK
|   |   |-- fileL
|   |   |-- fileM
|   |   `-- fileN
|   `-- fileO
|-- fileA
|-- fileB
|-- fileC
`-- .gitignore

The contents of the .gitignore file are :

fileB
directoryD/*
directoryG/*

Now if we use pathspec to match all the files with the specs defined in .gitignore then here are the responses of match_file(filepath) function:

|-- directoryD : False
|   |-- fileE : True
|   `-- fileF : True
|-- directoryG : False
|   `-- directoryH : True
|       |-- fileI : False
|       |-- fileJ : False
|       |-- fileK : False
|       |-- fileL : False
|       |-- fileM : False
|       `-- fileN : False
|   `-- fileO : True
|-- fileA : False
|-- fileB : True
|-- fileC : True
`-- .gitignore

If you compare it with the behaviour of .gitignore inside a git repository, the files inside directoryH should all return True as a reponse to the match_file function. Or am I getting something wrong ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions