Find the repository root by searching for .atomic directory. Starts at the given path and walks up to parent directories until a `.atomic` directory is found that contains a repository database (`atomic.redb`, or the legacy `pristine.redb`), distinguishing it from a config directory like `~/.atomic/`. The search stops at the user's home directory to prevent accidentally treating the entire home
(start: &Path)
| 1103 | /// The search stops at the user's home directory to prevent accidentally |
| 1104 | /// treating the entire home directory as a repository. |
| 1105 | pub fn find_root(start: &Path) -> Result<PathBuf, RepositoryError> { |
| 1106 | // Service resolution is a path-only lookup. Preserve dev's sandbox |
| 1107 | // discovery while also recognizing #207's linked worktree layouts. |
| 1108 | if let Some((working_root, _, _)) = sandbox::detect_sandbox(start) { |
| 1109 | return Ok(working_root); |
| 1110 | } |
| 1111 | working_copy::discover_layout(start).map(|layout| layout.working_root) |
| 1112 | } |
| 1113 | |
| 1114 | // ── Path accessors ────────────────────────────────────────────────── |
| 1115 |
nothing calls this directly
no test coverage detected