fix(cli): stop parent traversal at .git boundary #170
Reference in New Issue
Block a user
Delete Branch "fix/168-git-boundary"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Add
.gitboundary check tofindWorkflowInParents()(thread.ts) anddiscoverProjectWorkflows()(store.ts). Both directory and file.git(worktree) are treated as boundaries.Why
.workflow/is a project-local concept. In a monorepo, traversal from a subdirectory should stop at the repo root (where.gitlives), not continue up to~or/where unrelated.workflow/directories could leak in.The docstring for
findWorkflowInParentsalready claimed it "Stops at filesystem root or .git directory" but the.gitcheck was missing.Changes
packages/cli/src/commands/thread.ts—findWorkflowInParents(): insert.gitcheck after scanning currentDir and before moving to parent.packages/cli/src/store.ts—discoverProjectWorkflows(): same.gitboundary check.packages/cli/src/__tests__/workflow-list-recursive.test.ts— 6 new test cases (G1–G6) covering.gitdirectory,.gitfile (worktree), workflow-at-boundary, and traversal-cut-off scenarios.@united-workforce/clipatch.Ref
Fixes #168
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.