get_default

Function get_default 

Source
pub fn get_default(repo: &Repository) -> Result<Reference<'_>>
Expand description

Retrieves the default remote HEAD reference from the repository.

Iterates over all configured remotes and returns the first valid refs/remotes/{remote}/HEAD reference, which typically points to the default branch (e.g., main, or master) on that remote.

ยงErrors

  • If no remote has a valid HEAD reference.