git

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 4 Imported by: 1 module, 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 git reads local checkouts with the git binary, as the planner asks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exec

type Exec struct{}

Exec runs git on the PATH.

func (Exec) CheckedOutAt

func (g Exec) CheckedOutAt(ctx context.Context, dir, branch string) (string, error)

CheckedOutAt is the worktree that has branch checked out; "" for none.

func (Exec) HasCommit

func (g Exec) HasCommit(ctx context.Context, dir, oid string) (bool, error)

HasCommit says whether the object database of dir holds the commit.

func (Exec) IsAncestor

func (g Exec) IsAncestor(ctx context.Context, dir, ancestor, commit string) (bool, error)

IsAncestor says whether ancestor is reachable from commit; an unknown object is not an ancestor.

func (Exec) LocalBranchTip

func (g Exec) LocalBranchTip(ctx context.Context, dir, branch string) (string, error)

LocalBranchTip is the commit branch points at in dir; "" when there is no such branch.

func (Exec) Upstream

func (g Exec) Upstream(ctx context.Context, dir string) (string, error)

Upstream is the remote branch the checkout at dir pushes to; "" for none.

Jump to

Keyboard shortcuts

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