gitutil

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gitutil wraps the few git operations jt needs.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotARepo = errors.New("not inside a git repository")

ErrNotARepo is returned outside a git work tree.

Functions

func BranchExists

func BranchExists(name string) bool

BranchExists reports whether a local branch exists.

func CurrentBranch

func CurrentBranch() (string, error)

CurrentBranch returns the checked-out branch name.

func IssueKey

func IssueKey(branch string) string

IssueKey extracts the first issue key from a branch name, e.g. "feat/DATA-12-add-retry" → "DATA-12". It returns "" if there is none.

func Switch

func Switch(name, base string) (bool, error)

Switch checks out name, creating it from base (or HEAD) if it is new. It reports whether the branch was created.

Types

This section is empty.

Jump to

Keyboard shortcuts

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