goelhardik/ignore

Bug Ignore.Add("folder") match also folder with prefix

mhascak opened this issue · 1 comments

Hello, I have problem with this case:

Unit test:

[TestCase]
    public void TestIngoreMorePatterns()
    {
        var ignore = new Ignore.Ignore();
        ignore.Add("!.gitignore");
        ignore.Add("folder");

        ignore.IsIgnored(@".gitignore").Should().BeFalse();
        ignore.IsIgnored(@"src/Testfolder/.gitignore").Should().BeFalse();
        ignore.IsIgnored(@"tools/Testfolder/.gitignore").Should().BeFalse();
}

Test is failing but it should not. Testfolder is not folder.

Thanks for reporting the issue with the unit test example @mhascak.