Skip to content

Preserve literal filenames when marking ignored files - #1250

Closed
Afloat (Afloat16) wants to merge 2 commits into
JetBrains:mainfrom
Afloat16:fix/literal-gitignored-paths
Closed

Afloat (Afloat16) wants to merge 2 commits into
JetBrains:mainfrom
Afloat16:fix/literal-gitignored-paths

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

Pass worktree-relative paths to git check-ignore on stdin and read NUL-delimited results. This preserves quotes, tabs, line breaks and backslashes. Prefix each input with ./ so pathspec-like names do not invalidate the rest of the batch. The bounded subprocess runner retains its existing timeout and accepts a Blob for this call.

Five regression cases failed on the base and passed against the changed TypeScript function using Node 24 and a real temporary Git repository. The harness supplied the Git subprocess adapter. Bun 1.4.4 aborted at startup in the local environment, so the in-tree Bun tests await CI.

@jetbrains-air jetbrains-air Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved — ready to merge.

Comment thread packages/server/src/git/ignored.ts Resolved

@jetbrains-air jetbrains-air Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved — ready to merge.

@danyaberezun

Copy link
Copy Markdown
Collaborator

Thanks Afloat (@Afloat16) — the literal-filename fix landed as part of #1137, credited to you as co-author. #1137 rewrote the same ignoredPaths function (a fast --no-index first pass), so we folded your fix in there rather than merge two competing versions: the first pass reads ./<path> records from --stdin -z, and the index pass keeps arguments (one index scan per batch — --stdin rescans the index per path, ~3× slower on large repos) and unquotes git's C-quoted names, so ", \, control characters and pathspec-looking names stay literal. Your tests for those names came along. Closing this in favour of #1137.

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.

2 participants