Skip to content

/files throws error upon selecting a file if you are in a git worktree #891

@markjaquith

Description

@markjaquith

If you are in a git worktree (from a git repo, type git worktree add ../worktree-test && cd ../worktree-test), the /files command will list files, but selecting one will produce an error:

Failed to read file

Notably, in git worktrees, .git is a file, not a directory. If I rename/remove that file, the error goes away, so I would expect that opencode is doing some sort of git repo introspection before reading a file that works on a regular git checkout, but not a git worktree.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions