Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Question on WorkingTreeIterator.isEntryIgnored

"Baumgart, Jens" <jens.baumgart@xxxxxxx> wrote:
> Given an entry in .gitignore, e.g. folder1 and a TreeWalk on the working directory.
> TreeWalk is on folder1. When I call WorkingTreeIterator.isEntryIgnored I get false as result.
> 
> It seems that isIgnored is only defined for files, right?
> I need a way to find out if a folder is ignored. This is needed for decoration purposes in EGit.

Not true, it is also defined for a directory.  Given an ignore
rule of "folder1" either a file or a directory named "folder1"
should be ignored.  If the ignore rule is "folder1/" then only
a directory called folder1 is ignored.

If isEntryIgnored is returning false and you are certain the ignore
rule matches the folder (case matters to Git even if it doesn't to
the filesystem!), it suggests a bug in the new ignore code.

-- 
Shawn.


Back to the top