package gitutil

import "github.com/docker/buildx/util/gitutil"

Index

Functions

func IsUnknownRevision

func IsUnknownRevision(err error) bool

Types

type Git

type Git struct {
	// contains filtered or unexported fields
}

Git represents an active git object

func New

func New(opts ...Option) (*Git, error)

New initializes a new git client

func (*Git) FullCommit

func (c *Git) FullCommit() (string, error)

func (*Git) GitDir

func (c *Git) GitDir() (string, error)

func (*Git) IsDirty

func (c *Git) IsDirty() bool

func (*Git) IsInsideWorkTree

func (c *Git) IsInsideWorkTree() bool

func (*Git) RemoteURL

func (c *Git) RemoteURL() (string, error)

func (*Git) RootDir

func (c *Git) RootDir() (string, error)

func (*Git) Run

func (c *Git) Run(args ...string) (string, error)

func (*Git) ShortCommit

func (c *Git) ShortCommit() (string, error)

func (*Git) Tag

func (c *Git) Tag() (string, error)

type Option

type Option func(b *Git)

Option provides a variadic option for configuring the git client.

func WithContext

func WithContext(ctx context.Context) Option

WithContext sets context.

func WithWorkingDir

func WithWorkingDir(wd string) Option

WithWorkingDir sets working directory.

Source Files

gitutil.go path.go

Directories

PathSynopsis
util/gitutil/gittestutil
Version
v0.23.0-rc2
Published
Apr 11, 2025
Platform
darwin/amd64
Imports
10 packages
Last checked
23 minutes ago

Tools for package owners.