repository

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package repository stores tools to work with git repository.

Index

Constants

View Source
const (
	// BumpMessage is bump commit message.
	BumpMessage = "versions bump"
	// Author is the name of bump commit author.
	Author = "Bumper"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bumper

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

Bumper encapsulates Git-related operations for bumping versions in a Git repository.

func NewBumper

func NewBumper() (*Bumper, error)

NewBumper returns new instance of Bumper.

func (*Bumper) Commit

func (r *Bumper) Commit() error

Commit stores the current changes to the Git repository with the default commit message and author.

func (*Bumper) GetCommits added in v2.2.1

func (r *Bumper) GetCommits(last bool) ([]*Commit, error)

GetCommits gets a list of commits before Bump.

func (*Bumper) GetComparisonCommit

func (r *Bumper) GetComparisonCommit(from plumbing.Hash, searchMessage string) (*plumbing.Hash, error)

GetComparisonCommit returns the commit that contains the specified search message.

func (*Bumper) GetGit

func (r *Bumper) GetGit() *git.Repository

GetGit returns internal *git.Repository

func (*Bumper) GetRepoName

func (r *Bumper) GetRepoName() (string, error)

GetRepoName retrieves the name of the remote repository. It looks for the remote named "origin" and extracts the repository name from the remote's URL. It returns the repository name as a string and an error if the remote is not found or the repository name cannot be extracted.

func (*Bumper) IsOwnCommit

func (r *Bumper) IsOwnCommit() bool

IsOwnCommit checks if the latest commit in the Git repository was made by the bumper.

type Commit added in v2.2.1

type Commit struct {
	Hash  string
	Files []string
}

Commit stores commits hash and list of modified files in it.

Jump to

Keyboard shortcuts

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