Skip to main content

Module git

Module git 

Source
Expand description

Pure-filesystem git branch lookup. No git shell-out.

Structs§

HeadInfo
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 freshly git 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 None outside a git repo.
head_info
Branch name and short commit hash for the repo containing start, or None outside a git repo. On a branch, both fields are populated when the ref resolves to a commit. Detached HEAD yields branch: None with the hash.