Repository navigation
fix(core): skip Git worktree discovery for non-Git directories - #58025
xiaoheiai4719-collab wants to merge 2 commits into
Conversation
|
Verified on Windows 11 (build 26300) by applying this PR's two commits on top of current dev (956e41f). I cherry-picked them since the PR base (248bfbe) is older.
Real-world context: my own The change is small and behaves as described. It's still a draft with no review since Oct 22, so happy to re-run anything if useful. |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #57989
Type of change
What does this PR do?
Return an empty Git worktree list for an existing non-Git directory, so ordinary project refresh does not log DirectoryUnavailableError. Missing directories still fail; create/remove are unchanged.
Git.repo.discover already returns undefined for an unresolvable Git marker, so that case also returns an empty list. No new catch hides errors from Git.worktree.list.
How did you verify your code works?
Real filesystem/Git regressions: 3 failures before, 40 passes after. The focused suite passes 400/400 with ten repeats on pinned Bun 1.4.2; it also passed 400/400 under full-suite load on Bun 1.4.3. From packages/core: bun run script/test.ts test/worktree.test.ts --rerun-each 10.
Core typecheck and the complete root lint plus 34 typecheck tasks pass (serial, Bun 1.4.3).
Full core tests on Bun 1.4.3: 6,710 passed, 39 skipped, 10 failed. The same ten failures reproduce with unchanged production source on both Bun versions: patch permissions, VCS initialization, six daemon socket cases, and two configuration-discovery cases. Full-suite qualification is incomplete; these are not claimed as passes. Linux only; Windows was not run.
AI-assisted implementation and command execution; the publication owner has not personally rerun these checks.
Screenshots / recordings
No UI change.
Checklist