Open
Description
Version
latest
Operating System
Linux/Unix, MacOS
Bug description
a .gitignore file containing a single ignore rule for a directory fails to match correctly.
/directory/nested/
should be ignoring /directory/nested/again
directory
Actual behavior
the result given back is CHECK_PARENT
Expected behavior
the result given back is IGNORED
Relevant log output
No response
Other information
I have a test showcasing this behaviour in my fork (will link commit). Here more insights/debugging can be found.
Caused by the fact that IgnoreNode
is always passing true
as pathMatch
to the rule.isMatch
@Test
public void fastIgnoreRuleForNestedDirectory() {
//This PASSES as isMatch returns true
FastIgnoreRule ignoreRule1 = new FastIgnoreRule("/directory/nested/");
assertTrue(ignoreRule1.isMatch("/directory/nested/again", true, false));
//This FAILS as isMatch returns false
FastIgnoreRule ignoreRule2 = new FastIgnoreRule("/directory/nested/");
assertTrue(ignoreRule2.isMatch("/directory/nested/again", true, true));
}
Metadata
Metadata
Assignees
Labels
No labels