You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Opt-in size limit for ignore files read from disk #29
New and AddFromFile call os.ReadFile on each .gitignore, then compile every line into a pattern. Cost is linear in file size (roughly 2-3x the raw bytes once compiled), which is correct and matches git, but a caller walking many untrusted clones has no way to bound it short of statting every candidate file itself before constructing the matcher.
An opt-in ceiling would let such callers set a per-file cap without changing default behaviour:
or a field on Matcher that AddFromFile consults. Files over the limit would be skipped with an entry in Errors(). Default (0 / unset) keeps current behaviour so parity with git is preserved unless the caller asks otherwise.
Related: #28 covers the separate case where a single long line inside the file truncates parsing.
Activity