Expand description
Pure-filesystem git branch lookup. No git shell-out.
Structs§
- Head
Info - Resolved HEAD state for a working tree: the branch name (when on a branch)
and the short commit hash. Either field may be
None— e.g. a freshlygit init’d repo with no commits has a branch but no hash, and a detached HEAD has a hash but no branch.
Functions§
- branch_
for - Branch name, short SHA for detached HEAD, or
Noneoutside a git repo. - head_
info - Branch name and short commit hash for the repo containing
start, orNoneoutside a git repo. On a branch, both fields are populated when the ref resolves to a commit. Detached HEAD yieldsbranch: Nonewith the hash.