goelhardik / ignore

.gitignore based parser implemented in C# according to the .gitignore spec 2.29.2.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

mhascak opened this issue · 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.