git

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

type Runner struct {
	RepoPath string
}

Runner executes git commands against a repository.

func NewRunner

func NewRunner(repoPath string) *Runner

NewRunner creates a Runner for the given repository path.

func (*Runner) ArchiveModule

func (r *Runner) ArchiveModule(tag, modulePath, destPath string) error

ArchiveModule creates a tar.gz archive of the module directory at the given tag's commit. It writes to destPath. Files are placed at the root of the archive (no directory prefix).

func (*Runner) CreateTag

func (r *Runner) CreateTag(tag, message string) error

CreateTag creates an annotated tag.

func (*Runner) CurrentBranch

func (r *Runner) CurrentBranch() (string, error)

CurrentBranch returns the current branch name.

func (*Runner) ExtractModuleAtTag

func (r *Runner) ExtractModuleAtTag(tag, modulePath string) (string, func(), error)

ExtractModuleAtTag extracts a module directory at a given tag into a temporary directory and returns its path. The caller must call the returned cleanup function when done.

func (*Runner) Fetch

func (r *Runner) Fetch() error

Fetch fetches from the default remote.

func (*Runner) IsClean

func (r *Runner) IsClean() (bool, error)

IsClean returns true if the working tree has no uncommitted changes.

func (*Runner) IsUpToDate

func (r *Runner) IsUpToDate(branch string) (bool, error)

IsUpToDate checks if the local branch is up to date with its remote tracking branch.

func (*Runner) ListFilesAtTag

func (r *Runner) ListFilesAtTag(tag, path string) ([]string, error)

ListFilesAtTag lists files under a path at a given tag.

func (*Runner) ListTags

func (r *Runner) ListTags() ([]string, error)

ListTags returns all tags in the repository.

func (*Runner) ListTagsWithPrefix

func (r *Runner) ListTagsWithPrefix(prefix string) ([]string, error)

ListTagsWithPrefix returns tags matching a given prefix.

func (*Runner) ModuleHasChanges

func (r *Runner) ModuleHasChanges(tag, modulePath string) (bool, error)

ModuleHasChanges reports whether the given module path has changes between the specified tag and HEAD.

func (*Runner) PathExistsAtTag

func (r *Runner) PathExistsAtTag(tag, path string) (bool, error)

PathExistsAtTag checks if a path exists in the tree at the given tag.

func (*Runner) PushTag

func (r *Runner) PushTag(tag string) error

PushTag pushes a single tag to origin.

func (*Runner) ShowFileAtTag

func (r *Runner) ShowFileAtTag(tag, path string) (string, error)

ShowFileAtTag returns the contents of a file at a given tag. Returns empty string and no error if the file does not exist.

func (*Runner) TagExists

func (r *Runner) TagExists(tag string) (bool, error)

TagExists checks if a tag already exists.

func (*Runner) TopLevel

func (r *Runner) TopLevel() (string, error)

TopLevel returns the absolute path to the repository root. This resolves the actual git worktree root, which matters when RepoPath is "." or a subdirectory.

Jump to

Keyboard shortcuts

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