daemon: gitroot walk-up probe (infer worktree base repo) #25

Closed
opened 2026-06-20 14:38:57 +01:00 by naps62-yolo · 0 comments
Collaborator

So worktree spawns need only a branch name: infer base_repo from the chosen working dir.

  • Pure resolver in the dirlist-style module: walk up from a path to the enclosing git toplevel (.git), return Option<PathBuf>.
  • Drives the spawn form's worktree section: if the chosen dir is inside a repo, that repo is used as base_repo (checkout path stays daemon-auto-generated <worktree_root>/<slug>-<uuid>); if not, the worktree toggle is disabled with a hint.

Tests

Unit tests: dir inside repo → toplevel; nested subdir → toplevel; non-repo dir → None.


Part of #21 (spawn dialog rework).

So worktree spawns need only a branch name: infer `base_repo` from the chosen working dir. - Pure resolver in the `dirlist`-style module: walk up from a path to the enclosing git toplevel (`.git`), return `Option<PathBuf>`. - Drives the spawn form's worktree section: if the chosen dir is inside a repo, that repo is used as `base_repo` (checkout path stays daemon-auto-generated `<worktree_root>/<slug>-<uuid>`); if not, the worktree toggle is disabled with a hint. ### Tests Unit tests: dir inside repo → toplevel; nested subdir → toplevel; non-repo dir → None. --- Part of #21 (spawn dialog rework).
naps62-yolo self-assigned this 2026-06-20 21:36:39 +01:00
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Reference: naps62/maestro#25