Problem
src/CodeIndex/Cli/GitHelper.cs resolves linked worktrees by reading .git and commondir files with File.ReadAllText and no size check.
Impact
A malformed checkout or attacker-controlled workspace can make repository resolution allocate large buffers before normal git safeguards run.
Expected
Treat these metadata files as tiny control files: check length before reading, reject oversized content, and keep the existing linked-worktree behavior for valid files.
Problem
src/CodeIndex/Cli/GitHelper.csresolves linked worktrees by reading.gitandcommondirfiles withFile.ReadAllTextand no size check.Impact
A malformed checkout or attacker-controlled workspace can make repository resolution allocate large buffers before normal git safeguards run.
Expected
Treat these metadata files as tiny control files: check length before reading, reject oversized content, and keep the existing linked-worktree behavior for valid files.