(start: &Path)
| 487 | } |
| 488 | |
| 489 | fn detect_worktree_stop(start: &Path) -> PathBuf { |
| 490 | let mut current = normalize_existing_path(start); |
| 491 | let mut topmost = current.clone(); |
| 492 | loop { |
| 493 | if current.join(".git").exists() { |
| 494 | return current; |
| 495 | } |
| 496 | let Some(parent) = current.parent() else { |
| 497 | return topmost; |
| 498 | }; |
| 499 | if parent == current { |
| 500 | return topmost; |
| 501 | } |
| 502 | topmost = parent.to_path_buf(); |
| 503 | current = parent.to_path_buf(); |
| 504 | } |
| 505 | } |
| 506 | |
| 507 | fn find_up(target: &str, start: &Path, stop: &Path) -> Vec<PathBuf> { |
| 508 | let mut current = normalize_existing_path(start); |
no test coverage detected