Documentation ¶ Overview ¶ Package gitbranch resolves the current branch of a git working directory by reading .git metadata directly, without shelling out to the git binary. Index ¶ func Current(dir string) string Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Current ¶ func Current(dir string) string Current returns the current branch name (or the short commit for a detached HEAD) for the repository containing dir, walking up parent directories until a .git entry is found. It returns "" when dir is empty or not inside a repository. Types ¶ This section is empty. Source Files ¶ View all Source files gitbranch.go Click to show internal directories. Click to hide internal directories.