git

package
v1.0.5-0...-31fe0a3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: MIT Imports: 10 Imported by: 0

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