Skip to content

fix: whitespace-only .gitignore lines no longer match every file - #3462

Open
cpruijsen wants to merge 2 commits into
LuaLS:masterfrom
cpruijsen:fix/issue-3458
Open

fix: whitespace-only .gitignore lines no longer match every file#3462
cpruijsen wants to merge 2 commits into
LuaLS:masterfrom
cpruijsen:fix/issue-3458

Conversation

@cpruijsen

Copy link
Copy Markdown

A .gitignore line holding only whitespace made the whole workspace disappear from the language
server. Git treats such a line as blank and skips it, so the file looks harmless in review, and the
symptom is that every file in the project silently stops resolving.

mt:pattern in script/glob/matcher.lua read state[1] without checking it was there. A
whitespace-only line leaves the state empty, the pattern compiles to something that matches
everything, and the matcher then ignores the workspace root. This returns nil for that state
instead, which is how the caller already represents "this line contributes no pattern", so the line
is skipped exactly as git skips it.

Changelog entry included, per the repo convention of adding one under Unreleased.

Fixes #3458

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice: It looks like you're using hustcer/deepseek-review, but the CHAT_TOKEN hasn't been configured in your repo's Variables/Secrets. Please ensure this token is set for proper functionality. For step-by-step guidance, refer to the CHAT_TOKEN Config section of README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Line with just a space in gitignore causes whole project to be ignored

1 participant