Skip to main content

find_git_root

Function find_git_root 

Source
pub fn find_git_root(start: &Path) -> Option<PathBuf>
Expand description

Walk up from start looking for a .git entry (a directory or a file — a submodule/worktree gitlink is a file), returning the directory that contains it (the git work-tree root), or None. Bounded to 64 ancestors. Pure filesystem, no subprocess — deterministic for tests.