git

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

View Source
const (
	OriginDefault = "origin"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	When  time.Time
	Name  string
	Email string
}

type Commit

type Commit struct {
	Author  Author
	Message string
	Hash    plumbing.Hash
}

Commit stores all git-commit information

type Repository

type Repository interface {
	HeadReference() (*plumbing.Reference, error)

	HeadBranchName() (string, error)

	Log(fromRev, toRev string) ([]Commit, error)

	FetchTags() error

	CommitLatestTagByTime() (*Commit, error)
	CommitTagSearchByName(tagName string) (*Commit, error)
	CommitTagSearchByFirstLine(firstLine string) (*Commit, error)
	Commit(commitMessage string, paths ...string) error

	TagLatestByCommitTime() (*object.Tag, error)

	RemoteInfo(remoteName string, configUrlIndex int) (*git_info.GitRemoteInfo, error)
}

Repository is an abstraction for git-repository

func NewRepositoryByPath added in v1.3.0

func NewRepositoryByPath(path string) (Repository, error)

NewRepositoryByPath return Repository from path

func NewRepositoryClone added in v1.3.0

func NewRepositoryClone(s storage.Storer, worktree billy.Filesystem, o *goGit.CloneOptions) (Repository, error)

NewRepositoryClone return Repository from git.Repository

func NewRepositoryRemoteByPath added in v1.7.0

func NewRepositoryRemoteByPath(remote string, path string) (Repository, error)

NewRepositoryRemoteByPath remote most is git.OriginDefault return Repository from path

func NewRepositoryRemoteClone added in v1.7.0

func NewRepositoryRemoteClone(remote string, s storage.Storer, worktree billy.Filesystem, o *goGit.CloneOptions) (Repository, error)

NewRepositoryRemoteClone remote most is git.OriginDefault return Repository from git.Repository

Jump to

Keyboard shortcuts

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