Summary
worktree_prepare and auto-provisioned write flows can fail in repositories that have no commits yet.
In that state, remote/default-branch detection can resolve to "(unknown)", and the plugin later tries to fetch or use that as a real ref, which produces:
fatal: couldn't find remote ref (unknown)
Current behavior
When the repository is still empty and no branch exists remotely yet, default-branch detection may surface (unknown) from git remote show <remote>.
The plugin currently treats that as a valid branch name and continues into base-target resolution, which then tries to fetch or use (unknown) as the base ref.
Expected behavior
Empty repositories should be handled explicitly.
Acceptable outcomes include:
- detect the empty or unborn repo state and return a clear, actionable error
- or skip remote base resolution until an initial commit or default branch exists
- but do not treat
(unknown) as a valid branch or ref
Why this matters
This blocks worktree provisioning and contributes to broken plugin-managed write flows during repository bootstrap.
Related
Summary
worktree_prepareand auto-provisioned write flows can fail in repositories that have no commits yet.In that state, remote/default-branch detection can resolve to
"(unknown)", and the plugin later tries to fetch or use that as a real ref, which produces:fatal: couldn't find remote ref (unknown)Current behavior
When the repository is still empty and no branch exists remotely yet, default-branch detection may surface
(unknown)fromgit remote show <remote>.The plugin currently treats that as a valid branch name and continues into base-target resolution, which then tries to fetch or use
(unknown)as the base ref.Expected behavior
Empty repositories should be handled explicitly.
Acceptable outcomes include:
(unknown)as a valid branch or refWhy this matters
This blocks worktree provisioning and contributes to broken plugin-managed write flows during repository bootstrap.
Related