pub fn repository_root(directory: &Path) -> Option<PathBuf>
The work-tree root containing directory, or None if it is not a repo / git is unavailable. Mirrors git rev-parse --show-toplevel.
directory
None
git rev-parse --show-toplevel