pub fn current_branch(path: &Path) -> Result<String>
Returns an error if the path is not a git repository or if HEAD is detached.