Documentation
¶
Overview ¶
Package gitinfo reads minimal git metadata from the working tree without shelling out — only the files needed to identify the current branch.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentBranch ¶
CurrentBranch returns the branch name at HEAD for the given working directory. Returns an empty string when:
- cwd is empty or not inside a git repository
- HEAD is detached (no symbolic ref)
- any required file is unreadable
Supports both regular repos (.git is a directory) and linked worktrees (.git is a file pointing to gitdir).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.