Skip to main content

detect_default_branch

Function detect_default_branch 

Source
pub async fn detect_default_branch(project_dir: &Path) -> String
Expand description

Detect the default branch of a repository.

Tries multiple strategies and normalizes the result so callers always receive a clean branch name like "main", never a raw ref path.