fix(opencode): resolve git worktree .git files#7517
fix(opencode): resolve git worktree .git files#7517rygwdn wants to merge 1 commit intoanomalyco:devfrom
Conversation
## Summary - Read .git files and follow `gitdir:` references to actual git directory - Handles both absolute and relative paths - Falls back gracefully when target doesn't exist ## Why Git worktrees create a `.git` file (not directory) containing a path to the actual git directory. Without following this reference, project resolution could fail or be slower in worktree scenarios. ## Testing - Added test for absolute gitdir path resolution - Added test for relative gitdir path resolution - Added test for non-existent target fallback
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found several potentially related PRs that might be addressing similar git-related issues: Related PRs (Not Direct Duplicates)
These PRs touch on worktree and git path handling, but none appear to be direct duplicates of PR #7517. Your PR (#7517) specifically addresses the performance issue of resolving |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
What does this PR do?
gitdir:references to actual git directoryWhy?
Git worktrees create a
.gitfile (not directory) containing a path to the actual git directory. Without following this reference, the code fails to store the cached ID, which slows down subsequent startups.How did you verify your code works?