git

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Clone(ctx context.Context, url, path, remoteName string) error
	CloneBare(ctx context.Context, url, path, remoteName string) error
	AddRemote(path, name, url string) error
	Fetch(ctx context.Context, repoPath, remoteName string) error
	Status(path string) (StatusSummary, error)
	IsRepo(path string) (bool, error)
	IsAncestor(repoPath, ancestorRef, descendantRef string) (bool, error)
	IsContentMerged(repoPath, branchRef, baseRef string) (bool, error)
	CurrentBranch(repoPath string) (string, bool, error)
	RemoteExists(repoPath, remoteName string) (bool, error)
	WorktreeAdd(ctx context.Context, opts WorktreeAddOptions) error
	WorktreeRemove(repoPath, worktreeName string) error
	WorktreeList(repoPath string) ([]string, error)
}

type GoGitClient

type GoGitClient struct{}

func NewGoGitClient

func NewGoGitClient() GoGitClient

func (GoGitClient) AddRemote

func (c GoGitClient) AddRemote(path, name, url string) error

func (GoGitClient) Clone

func (c GoGitClient) Clone(ctx context.Context, url, path, remoteName string) error

func (GoGitClient) CloneBare

func (c GoGitClient) CloneBare(ctx context.Context, url, path, remoteName string) error

func (GoGitClient) CurrentBranch

func (c GoGitClient) CurrentBranch(repoPath string) (string, bool, error)

func (GoGitClient) Fetch

func (c GoGitClient) Fetch(ctx context.Context, repoPath, remoteName string) error

func (GoGitClient) IsAncestor

func (c GoGitClient) IsAncestor(repoPath, ancestorRef, descendantRef string) (bool, error)

func (GoGitClient) IsContentMerged added in v0.2.0

func (c GoGitClient) IsContentMerged(repoPath, branchRef, baseRef string) (bool, error)

func (GoGitClient) IsRepo

func (c GoGitClient) IsRepo(path string) (bool, error)

func (GoGitClient) RemoteExists

func (c GoGitClient) RemoteExists(repoPath, remoteName string) (bool, error)

func (GoGitClient) Status

func (c GoGitClient) Status(path string) (StatusSummary, error)

func (GoGitClient) WorktreeAdd

func (c GoGitClient) WorktreeAdd(ctx context.Context, opts WorktreeAddOptions) error

func (GoGitClient) WorktreeList

func (c GoGitClient) WorktreeList(repoPath string) ([]string, error)

func (GoGitClient) WorktreeRemove

func (c GoGitClient) WorktreeRemove(repoPath, worktreeName string) error

type StatusSummary

type StatusSummary struct {
	Dirty   bool
	Missing bool
}

type WorktreeAddOptions

type WorktreeAddOptions struct {
	RepoPath      string
	WorktreePath  string
	WorktreeName  string
	BranchName    string
	StartRemote   string
	StartBranch   string
	ForceCheckout bool
}

Jump to

Keyboard shortcuts

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