git

package
v1.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CommitNameError = errors.New("failed to find commit hash")
View Source
var RepositoryNameError = errors.New("failed to find repository name")

Functions

func FindBranch

func FindBranch(repository *git.Repository) (string, error)

func FindCommit

func FindCommit(repository *git.Repository) (*object.Commit, error)

func FindCommitAuthor

func FindCommitAuthor(repository *git.Repository) (string, error)

func FindCommitHash

func FindCommitHash(repository *git.Repository) (string, error)

func FindRemoteUrl

func FindRemoteUrl(repository *git.Repository) (string, error)

FindRemoteUrl returns first remote URL found in the repository

func FindRepository

func FindRepository(path string) (*git.Repository, error)

func FindRepositoryName

func FindRepositoryName(repository *git.Repository, path string) (string, error)

func FindRepositoryUrl

func FindRepositoryUrl(repository *git.Repository) (string, error)

func ParseGitRemoteUrl

func ParseGitRemoteUrl(gitRemoteUrl string) (string, error)

Types

type MetaObject

type MetaObject struct {
	RepositoryName    string
	CommitName        string
	RepositoryUrl     string
	BranchName        string
	DefaultBranchName string
	Author            string
}

func NewMetaObject

func NewMetaObject(path string, repositoryName string, commit string, branchName string, commitAuthor string, url string) (*MetaObject, error)

NewMetaObject returns MetaObject based on git repository existing on path. Otherwise, inputted arguments are used

Jump to

Keyboard shortcuts

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