git

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package git reads the refs a dispatch can target. Every read goes through aragonite's vcs layer, so a jj checkout answers the same questions a git one does.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotInRepo = errors.New("not inside a git or jj repository")

ErrNotInRepo indicates no git or jj checkout contains the starting directory.

Functions

func DefaultBranches added in v1.0.3

func DefaultBranches() []string

DefaultBranches returns the fallback branch list used when none can be read. Callers append their own branch to it, so it hands back a copy.

func FetchBranches

func FetchBranches(ctx context.Context) ([]string, error)

FetchBranches names the branches the remote holds, which are the refs a dispatch can target. It falls back to the conventional names when the remote answers with none.

func GetCurrentBranch

func GetCurrentBranch(ctx context.Context) string

GetCurrentBranch returns the checked out branch, empty on a detached HEAD.

func GetDefaultBranch

func GetDefaultBranch(ctx context.Context) string

GetDefaultBranch returns the repository's default branch, empty when none can be determined.

func RepoRoot added in v1.11.0

func RepoRoot(start string) (string, error)

RepoRoot walks up from start to the checkout that holds it. Workflow and config paths resolve against the root rather than the working directory, so the tool reads the same repository from any subdirectory of it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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