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
P2: Background git reads take index.lock and read every untracked file on the main process #1520
There are two problems in the background git polling.
Lock contention with the agent. Read-only git status calls refresh the index and take index.lock, so they can make the agent's own git commit/git add fail mid-run. GIT_OPTIONAL_LOCKS is not set anywhere in electron/; the gitTryAsync env (electron/worktrees-git.js:372-376) only sets GIT_TERMINAL_PROMPT. Fix: set GIT_OPTIONAL_LOCKS=0 on every read-only git call (status, diff, log, rev-parse).
Unbounded untracked scan. The Changes scan runs status --porcelain -uall (electron/worktrees-changes.js:206). For each untracked file it then calls fs.readFileSync on the main process, only to count lines (:274-291). There is no count or size cap. A build output dir with no ignore rule (thousands of files, or large binaries) stalls the UI. Fix: cap the count (e.g. the first 500 untracked entries get line counts, the rest report 0 with a "+N more" note) and skip files over ~1 MB. Or move the counting to async reads with a budget.
Activity
Git read hygiene and PR polling: optional locks, untracked cap, GHE h…
fix(git): GIT_OPTIONAL_LOCKS=0 on read-only git calls (#1520)
fix(diff): cap untracked line counting at 500 files under 1 MB (#1520)