gitrepo

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenCurrent

func OpenCurrent(ctx context.Context) (*git.Repository, error)

OpenCurrent opens the current git worktree with object alternates enabled. The caller owns the returned repository and must close it.

func OpenPath

func OpenPath(repoRoot string) (*git.Repository, error)

OpenPath opens a git repository with object alternates enabled. The caller owns the returned repository and must close it.

func Status added in v0.10.0

func Status(_ context.Context, repo *git.Repository) (git.Status, error)

Status is the single entry point for reading go-git worktree status; the forbidigo rule in .golangci.yaml enforces this and names this signature, so the context parameter is part of that contract and is where cancellation or a perf span would attach.

Worktree.Status() walks the worktree, so its cost scales with working-set size rather than with the size of the change being inspected — it is the most expensive git read on the hook paths. Avoid calling it more than once per hook.

Types

This section is empty.

Jump to

Keyboard shortcuts

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