git

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: MIT Imports: 10 Imported by: 0 modules, 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHelper

type GitHelper struct {
	RepoPath string
}

GitHelper provides functionality to work with git repositories for contract extraction

func NewGitHelper

func NewGitHelper(repoPath string) *GitHelper

NewGitHelper creates a new GitHelper for the given repository path

func (*GitHelper) CompareRefs

func (g *GitHelper) CompareRefs(oldRef, newRef, packagePath string, extractor *contract.Extractor) (*contract.ContractDiff, error)

CompareRefs extracts contracts from two git references and compares them

func (*GitHelper) ExtractContractFromRef

func (g *GitHelper) ExtractContractFromRef(ref, packagePath string, extractor *contract.Extractor) (*contract.Contract, error)

ExtractContractFromRef extracts API contract from a specific git reference

func (*GitHelper) FindLatestVersionTag

func (g *GitHelper) FindLatestVersionTag(pattern string) (string, error)

FindLatestVersionTag finds the latest version tag matching the pattern

func (*GitHelper) GetAvailableRefs

func (g *GitHelper) GetAvailableRefs() ([]string, error)

GetAvailableRefs returns a list of available refs (branches and tags)

func (*GitHelper) GetCurrentRef

func (g *GitHelper) GetCurrentRef() (string, error)

GetCurrentRef gets the current git reference (branch or tag)

func (*GitHelper) IsGitRepository

func (g *GitHelper) IsGitRepository() bool

IsGitRepository checks if the given path is inside a git repository

func (*GitHelper) ListVersionTags

func (g *GitHelper) ListVersionTags(pattern string) ([]TagInfo, error)

ListVersionTags lists all version tags in the repository, sorted by version

type TagInfo

type TagInfo struct {
	Name      string
	Commit    string
	Date      time.Time
	Message   string
	IsVersion bool
}

TagInfo represents information about a git tag

Jump to

Keyboard shortcuts

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