ignore icon indicating copy to clipboard operation
ignore copied to clipboard

Ignore does not recognize the difference between rooted and non-rooted paths

Open JKamsker opened this issue 1 year ago • 1 comments

Pr https://github.com/goelhardik/ignore/pull/43/files displays the error

JKamsker avatar Dec 20 '23 12:12 JKamsker

Further it likely should allow setting the root for comparisons. If I read a .gitignore in it would be useful to be able to set the root that file is found in. That way paths passed are first converted relative to that root.

IE if var ignore = new Ignore(Root="c:/Data/MyRepo"); and then called with ignore.IsIgnored("c:/Data/MyRepo/bob/first"); it should test /bob/first as the path.

This is pretty easy to do if you use System.IO.Path.GetRelativePath

mitchcapper avatar Mar 11 '24 10:03 mitchcapper