Repository navigation
Description
Version 0.37.0, macOS.
I use a bare repository layout, where the project root holds a bare clone and all worktrees live next to it:
~/www/cosmos/
├── .bare/ # bare clone
├── .git # file containing "gitdir: ./.bare"
├── feature-a/ # worktree
└── feature-b/ # worktree
When I open this project, only "Work locally" is available. "New worktree" is disabled with "Project source is not a git repository", and "Existing worktree" says "No worktrees in this project yet". There are four worktrees.
The root is a valid git repository, it is just not a work tree:
$ git rev-parse --is-inside-work-tree
false # exit code 0
$ git rev-parse --is-bare-repository
true
$ git rev-parse --git-dir
/Users/me/www/cosmos/.bare
$ git worktree list
/Users/me/www/cosmos/.bare (bare)
/Users/me/www/cosmos/feature-a 375bb7d [feature-a]
/Users/me/www/cosmos/feature-b 75376c4 [feature-b]
I had a look at the bundled daemon (host-daemon/dist/daemon-bundle.mjs) and the detection seems to be a single helper:
let r = await Nt(["rev-parse", "--is-inside-work-tree"], { cwd: e, allowFailure: true });
return r.exitCode === 0 && Jl(r.stdout) === "true";All the git gates use it, so a bare root gets isGitRepo: false and the worktree options are disabled. Falling back to --is-inside-git-dir or --git-dir when --is-inside-work-tree is false would cover this layout.
Related: the "Existing worktree" list appears to be built from bb environments rather than from git worktree list --porcelain, so worktrees created outside bb are never offered. There is already a listWorktrees() in the codebase that could feed that list.
The layout is described here:
Activity
SawyerHood commentedon Aug 18, 2026
Reproduction & root-cause report: https://get-bb.github.io/reports/issues/1595.html
git rev-parse --is-inside-work-tree, which isfalse(exit 0) for a bare repo root, so ensureGitRepo/readGitRepositoryState/getCheckoutRef/host.list_branches/createWorktree all treat the bare-clone+worktrees layout as "not a git repository", disabling New worktree in the picker and failing worktree provisioning with not_git_repo.git rev-parse --is-inside-work-tree --is-bare-repository; keep detectGitRepo() = work-tree only (workspace semantics for status/diff/commit) and add detectGitSource() = work-tree or bare (source semantics). Use the source variant in readGitRepositoryState (feeds createWorktree), getCheckoutRef, the ref-reading helpers (readDefaultBranch, readDefaultBranchRefs, hasRef, listBranches) and the gate in apps/host-daemon/src/comm…The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at
16ceb3a54, and repro artifacts. It was independently re-run by a second agent (see its Verification section).Detect bare repositories as worktree sources (#2158)