[PR #10645] fix(opencode): handle bare git repos and worktrees created from them, FIX #10643 #13509

Open
opened 2026-02-16 18:18:21 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/10645

State: open
Merged: No


What does this PR do?

Worktree path is resolved incorrectly for bare repos, which makes later git operations run in a non‑repo directory.

FIX #10643

Detect bare repos with git rev-parse --is-bare-repository and set worktree to git rev-parse --git-common-dir when bare. Store the opencode id in the common-dir.

This makes bare repos work at a basic level. Some features still rely on a normal worktree, but the bare repo is now detected, and basic chat and code edits work.

How did you verify your code works?

I tested locally and added basic test cases.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/10645 **State:** open **Merged:** No --- ### What does this PR do? Worktree path is resolved incorrectly for bare repos, which makes later git operations run in a non‑repo directory. FIX #10643 Detect bare repos with `git rev-parse --is-bare-repository` and set worktree to `git rev-parse --git-common-dir` when bare. Store the opencode id in the `common-dir`. This makes bare repos work at a basic level. Some features still rely on a normal worktree, but the bare repo is now detected, and basic chat and code edits work. ### How did you verify your code works? I tested locally and added basic test cases.
yindo added the pull-request label 2026-02-16 18:18:21 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13509