Skip to main content

resolve_context_paths

Function resolve_context_paths 

Source
pub fn resolve_context_paths(start_dir: &Path) -> ContextPaths
Expand description

Resolve worktree-aware context paths from start_dir.

Resolution order:

  1. Run git rev-parse --git-common-dir --git-dir to locate the primary worktree.
    • tracevault_dir = parent(git_common_dir)/.tracevault
    • If git_dir == git_common_dir → Primary scope.
    • Else → Linked scope with key = basename(git_dir).
  2. Fallback (git not available or not a repo): delegate to crate::paths::resolve_project_root which walks up from start_dir to the nearest .tracevault/ (or returns start_dir as last resort). Treat as Primary scope in both cases.