gitbranch

package
v1.99.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL