Skip to content

Desktop project open uses bare repo path for bare-backed worktrees #25859

@osamu2001

Description

@osamu2001

Description

Opening a checked-out worktree from a bare repository in the Desktop app can resolve the project root/sidebar entry to the bare repository path instead of the selected worktree.

Project.fromDirectory currently uses git rev-parse --git-common-dir as project.worktree when core.bare=true. That preserves the project ID cache location, but Desktop surfaces also treat project.worktree as a checked-out workspace root.

Plugins

None

OpenCode version

Current dev branch

Steps to reproduce

  1. Create a bare repository.
  2. Add a git worktree from that bare repository.
  3. Open the checked-out worktree with the Desktop Open Project dialog.
  4. The project can collapse to the bare repository path instead of keeping the checked-out worktree as the project root.

Screenshot and/or share link

N/A

Operating System

macOS

Terminal

Desktop app

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions