Repository navigation
Register a created worktree when git stores a different path case than the workspace directory. - #45
Merged
nachumi-a2zoperations merged 2 commits intoNov 14, 2026
Conversation
…n the workspace directory. On a case-insensitive volume, git keeps the basename spelling from the repo path while metadata is stored under the directory entry. The list join publishes that creation record, a create that cannot join it fails, and a truncated or case-split scan no longer stops the live checkout's terminal.
…ratio guard for remote repos only (review round 1 on #45). Blocker: rememberLocalDirectoryIdentity cached same=false when stat threw, so a hand-deleted case-split worktree (still in git's list as prunable) poisoned the pair, and re-creating the same name made create throw createdWorktreeNotFoundError. Only two answered stats are cached now. Should-fix: the <25 % ratio guard ran for local repos too, so an out-of-band delete of most worktrees was never swept. A local repo checks every missing checkout on disk, so the guard now applies to remote repos only. Refs #6, #7
This was referenced Nov 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
orca worktree createfor a repo whose checkout path and workspace folder differ only by case (BLOWzer vs Blowzer on APFS) returned ok and created a git worktree, thenworktree listomitted it andworktree rm/worker-startreturned selector_not_found.Git keeps the spelling passed to
worktree add. That spelling comes frombasename(repo.path)incomputeWorktreePathFromWorkspaceRoot(src/main/ipc/worktree-logic.ts). Create then stores the strong metadata record underrev-parse --show-toplevel, which on a case-insensitive volume is the directory entry (describeCreatedWorktree→readRepoLocationinsrc/main/git/worktrees/catalog/worktree-listing.ts, persisted inmaterializeRuntimeLocalWorktree). The list join looked uprepoId::plus the git spelling exactly, missed the strong record, and stamped a thin row.hasStrongOrcaMetadata(src/shared/worktree/ownership.ts) is false for that thin row, so a nested path is classified external andshouldShowWorktreehides it. The main checkout stays visible because it is the selected checkout. The row count is not the 200-row list cap.The fix publishes the strong record's path when the git spelling is the same directory (same device and inode, and the paths differ only by case). The inode comparison is async and cached, so the list join stays synchronous and does not add a main-thread
statSync. POSIX paths are not case-folded in general, so SSH, WSL, and case-sensitive volumes stay distinct. A cold cache does not treat a case-only pair as one directory.id:andpath:selectors follow a warmed same-directory match. A create whose git path and metadata path differ only by case, and that does not resolve to the creation record, throwscreatedWorktreeNotFoundError(created but not found in listing), which the CLI reports as ok:false.That missed registration also kills the worker.
stopMissingWorktreeTerminals(src/main/runtime/workspaces/removal/missing-worktree-terminal-reconciliation.ts, called fromteardownMissingManagedWorktreeTerminals) stops every known id absent from the scan. The known id uses the directory-entry spelling and the scan id uses git's spelling, so a live checkout is "missing" and the pty records operator close. The sweep now skips a checkout the scan lists under a different case of the same directory, or whose directory still contains a.gitgitdir file or.gitdirectory. It also does nothing when the scan lists fewer than a quarter of the known ids (a truncated scan, not a deletion set). An empty scan can still stop checkouts that are gone.Fixes #6
Fixes #7
Refs A2Z-Operations/BLOWzer#97. That report is the same family only in that a BLOWzer worker died before it became a stable catalog row. The three deaths there are
failedStage: agent_readiness/process_exitedafter the process had started, and the same launch on z8-buzz (no case split) worked. Settings, project hooks, and MCP timeout are not disproved, so this PR does not claim to fix that issue.Test
repo-worktree-case-alias.test.tsbuilds a temp repo named BLOWzer, pre-creates the workspace folder Blowzer, and adds eight linked worktrees. It expects the list to publish the directory-entry spelling, ownershiporca-managed, and the thin row's comment. ForcingregisteredLocalWorktreePathto return undefined fails that test. No worktrees were created in the real BLOWzer checkout.