Skip to main content

Module branch

Module branch 

Source
Expand description

Git branch helpers for resolving the current branch name.

Responsibilities:

  • Determine the current branch name for the repository.
  • Fail fast on detached HEAD states to avoid ambiguous base branches.
  • Fast-forward the local base branch to origin/<branch> when required.

Not handled here:

  • Branch creation or deletion (see git/workspace.rs).
  • Push operations (see git/commit.rs).

Invariants/assumptions:

  • Caller expects a named branch (not detached HEAD).
  • Git is available and the repo root is valid.