I want to build a feature into my React application where I automatically exclude/filter out code files that would be excluded by the .gitignore file patterns on file upload.
However, it doesn't make any sense cause apparently git uses fnmatch(3)/glob but when I use different libraries that claim to apply to these filters it doesn't work properly e.g. minimatch (JavaScript), picomatch (JavaScript) and fnmatch (Python). For example, in .gitignore file you exclude directory via the following "[Bb]in/" however that doesn't match on anything. Are git just manually adding the asterisks like so "/[Bb]in/"? Also for files in .gitignore filters it out if you have "/access.log" and then access.log will be a match, but there is no match in these libraries.
Any help would be greatly appreciated!