fix(validation): support nested Git workspace roots - #298
Conversation
|
For context, this surfaced while using Opcore in a monorepo where validation was intentionally scoped to one nested workspace rather than the entire Git worktree. In that configuration, Opcore workspace paths are relative to the selected directory, while some Git operations require paths relative to the worktree root. Git listing commands also behave differently depending on the current directory and whether an explicit pathspec is provided. The result was a mismatch: before-state file reads could fail, and unrelated sibling changes could enter an otherwise scoped validation run. The fix preserves workspace-relative paths at the validation boundary, translates them only when accessing Git objects, and explicitly limits Git discovery to the selected workspace. This should support incremental or path-scoped Opcore adoption in monorepos without depending on any particular repository layout. The basic root-level workflow is unchanged: when the selected repo is the Git worktree root, the prefix is empty and these operations retain their existing behavior. The observable change is limited to nested |
Summary
Proof
Degraded coverage