Skip to content

snapshot: fix cwd for git commands in subdirs#28131

Open
simonklee wants to merge 1 commit into
devfrom
oc-snapshot-subdir
Open

snapshot: fix cwd for git commands in subdirs#28131
simonklee wants to merge 1 commit into
devfrom
oc-snapshot-subdir

Conversation

@simonklee
Copy link
Copy Markdown
Member

When opencode is launched from a git repository subdirectory, the snapshot service passes file paths relative to the worktree root but sets cwd to the launch directory. Git cannot resolve the paths and fails with "did not match any files".

Use the worktree root as cwd so paths resolve correctly regardless of which subdirectory opencode is started from.

Fix #27688
Close #27737

When opencode is launched from a git repository subdirectory,
the snapshot service passes file paths relative to the worktree
root but sets cwd to the launch directory. Git cannot resolve
the paths and fails with "did not match any files".

Use the worktree root as cwd so paths resolve correctly
regardless of which subdirectory opencode is started from.

Fix #27688
Close #27737
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Snapshot fails when opencode is opened in a git subdirectory (snapshot service cwd mismatch)

1 participant