(start: &Path)
| 414 | } |
| 415 | |
| 416 | fn nearest_project_like_root(start: &Path) -> Option<PathBuf> { |
| 417 | if let Some(root) = crate::worktree::git_worktree_root(start) { |
| 418 | return Some(root); |
| 419 | } |
| 420 | let mut dir = start.to_path_buf(); |
| 421 | loop { |
| 422 | if project_marker_exists(&dir) { |
| 423 | return Some(dir); |
| 424 | } |
| 425 | if !dir.pop() { |
| 426 | return None; |
| 427 | } |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | fn is_project_like_workspace(cwd: &Path) -> bool { |
| 432 | nearest_project_like_root(cwd).is_some() |
no test coverage detected