pub fn get_main_repo_root(repo: Option<&Path>) -> Result<PathBuf>
Get main repository path, even when called from a worktree.