git

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package git implements the git VCS backend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register()

Register registers the git backend with the backend registry.

Types

type Backend

type Backend struct{}

Backend implements backend.Backend for git repositories.

func (*Backend) Detect

func (*Backend) Detect(path string) (bool, error)

Detect checks for a .git directory.

func (*Backend) Name

func (*Backend) Name() string

func (*Backend) Priority

func (*Backend) Priority() int

Priority returns the git detection priority.

func (*Backend) Run

func (*Backend) Run(
	ctx context.Context,
	path string,
	args []string,
	interactive bool,
) (backend.RunResult, error)

Run executes arbitrary git args in path.

func (*Backend) Status

func (*Backend) Status(ctx context.Context, path string) (backend.RepoStatus, error)

Status queries git for the current branch/remote relationship and working tree cleanliness using a single `git status --porcelain=v2 --branch` call.

func (*Backend) SubcommandArgs added in v0.3.0

func (*Backend) SubcommandArgs(op string) []string

func (*Backend) Subcommands added in v0.10.0

func (*Backend) Subcommands(ctx context.Context) ([]string, error)

Subcommands shells out to git help -a and returns available subcommands.

Jump to

Keyboard shortcuts

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