Skip to main content

get_current_branch

Function get_current_branch 

Source
pub fn get_current_branch(root: impl AsRef<Path>) -> Result<String>
Expand description

Get the current git branch name

Returns the branch name (e.g., “main”, “feature-x”) or “HEAD” if in detached HEAD state.