pub fn branch(dir: &Path) -> Option<String>
The current branch name, or None when detached / not a repo. A detached HEAD yields the short commit hash via the caller’s discretion (here None).
None