Swiffty-Bot / CLI

0 stars 1 forks source link

not all gitignore syntax is covered #5

Open HyperCodec opened 3 months ago

HyperCodec commented 3 months ago

There's still all kinds of regex syntax that is not covered by the gitignore parser thingy.

HyperCodec commented 3 months ago

Consider https://docs.rs/git2/latest/git2/struct.Status.html#method.is_ignored

HyperCodec commented 3 months ago

https://docs.rs/git2/latest/git2/struct.Repository.html#method.statuses

HyperCodec commented 3 months ago

So essentially let statuses = repo.statuses(); and then let files_filtered: Vec<_> = old_files.into_iter().filter(|f| !statuses.get(f.path()).is_ignored()).collect()