MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / nearest_project_like_root

Function nearest_project_like_root

src/hooks/mod.rs:416–429  ·  view source on GitHub ↗
(start: &Path)

Source from the content-addressed store, hash-verified

414}
415
416fn 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
431fn is_project_like_workspace(cwd: &Path) -> bool {
432 nearest_project_like_root(cwd).is_some()

Calls 2

git_worktree_rootFunction · 0.85
project_marker_existsFunction · 0.85

Tested by

no test coverage detected