Skip to main content

git_branch

Function git_branch 

Source
pub fn git_branch(path: &Path) -> Option<String>
Expand description

The branch of the git checkout the path is in, read from HEAD (no git process). A worktree’s .git is a file that names its git folder; a relative name is relative to the folder that holds that file. The walk starts from std::path::absolute, not canonicalize: on Windows a canonical path is a \\?\ path, and those do not resolve .. or /, so the relative name is joined and cleaned up lexically instead.