Checklist
TagStudio Version
Alpha 9.5.5
Operating System & Version
macOS 15.6.1
Description
The ignore_to_glob() function is erroneously removing trailing slashes in ignore patterns, creating false positive matches with base patterns that should not be ignored.
Expected Behavior
The glob patterns generated by ignore_to_glob() should match one to one with .gitignore behavior.
Steps to Reproduce
Have a pattern such as *.key/** that's purpose is to allow .key bundle-like files but no inner items. Ripgrep respects this pattern as-is, but wcmatch needs to use the ignore_to_glob() function which is also used when determining ignore logic after a file has already been added to a library. Currently, that function will strip the trailing slash pattern in some cases and creates patterns such as *.key which no longer align with the base purpose.
Visually, this combination can lead to a scenario where ripgrep thinks it's okay to add a file (and is correct) but wcmatch thinks that it should be ignored. It not using ripgrep at all, this file never would have been added to the library in the first place unknowingly.

Logs
Part of logs about generated glob patterns for *.key/**:
**/*.key <- Incorrect
*.key <- Incorrect
*.key/** <- Unnecessary?
**/*.key/**
Checklist
TagStudio Version
Alpha 9.5.5
Operating System & Version
macOS 15.6.1
Description
The
ignore_to_glob()function is erroneously removing trailing slashes in ignore patterns, creating false positive matches with base patterns that should not be ignored.Expected Behavior
The glob patterns generated by
ignore_to_glob()should match one to one with .gitignore behavior.Steps to Reproduce
Have a pattern such as
*.key/**that's purpose is to allow.keybundle-like files but no inner items. Ripgrep respects this pattern as-is, but wcmatch needs to use theignore_to_glob()function which is also used when determining ignore logic after a file has already been added to a library. Currently, that function will strip the trailing slash pattern in some cases and creates patterns such as*.keywhich no longer align with the base purpose.Visually, this combination can lead to a scenario where ripgrep thinks it's okay to add a file (and is correct) but wcmatch thinks that it should be ignored. It not using ripgrep at all, this file never would have been added to the library in the first place unknowingly.

Logs
Part of logs about generated glob patterns for
*.key/**:**/*.key<- Incorrect*.key<- Incorrect*.key/**<- Unnecessary?**/*.key/**