Skip to main content

get_root

Function get_root 

Source
pub fn get_root(repo: &Repository) -> PathBuf
Expand description

Absolute working tree root path for the repository (or worktree).

Uses Repository::workdir which returns the correct root for both regular repositories and linked worktrees. Falls back to Repository::commondir (with .git stripped) for bare repositories.