git

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommitsBetween added in v0.5.0

func CommitsBetween(repoPath string, cfg Range) ([]string, error)

func FirstCommit added in v0.8.0

func FirstCommit(repoPath string) (string, error)

func HeadCommit

func HeadCommit(repoPath string) (string, error)

func HeadTag

func HeadTag(repoPath string) (string, error)

func HeadTagOrCommit

func HeadTagOrCommit(repoPath string) (string, error)

func IsRepository

func IsRepository(path string) bool

func RemoteURL

func RemoteURL(p string) (string, error)

TODO: can't use r.Config for same validation reasons

Types

type Interface added in v0.4.2

type Interface interface {
	FirstCommit() (string, error)
	HeadTagOrCommit() (string, error)
	HeadTag() (string, error)
	RemoteURL() (string, error)
	SearchForTag(tagRef string) (*Tag, error)
	TagsFromLocal() ([]Tag, error)
	CommitsBetween(Range) ([]string, error)
}

func New added in v0.4.2

func New(repoPath string) (Interface, error)

type MockInterface added in v0.4.2

type MockInterface struct {
	MockHeadOrTagCommit string
	MockHeadTag         string
	MockTags            []string
	MockRemoteURL       string
	MockSearchTag       string
	MockCommitsBetween  []string
	MockFirstCommit     string
}

func (MockInterface) CommitsBetween added in v0.5.0

func (m MockInterface) CommitsBetween(_ Range) ([]string, error)

func (MockInterface) FirstCommit added in v0.8.0

func (m MockInterface) FirstCommit() (string, error)

func (MockInterface) HeadTag added in v0.4.2

func (m MockInterface) HeadTag() (string, error)

func (MockInterface) HeadTagOrCommit added in v0.4.2

func (m MockInterface) HeadTagOrCommit() (string, error)

func (MockInterface) RemoteURL added in v0.4.2

func (m MockInterface) RemoteURL() (string, error)

func (MockInterface) SearchForTag added in v0.4.2

func (m MockInterface) SearchForTag(_ string) (*Tag, error)

func (MockInterface) TagsFromLocal added in v0.4.2

func (m MockInterface) TagsFromLocal() ([]Tag, error)

type Range added in v0.5.0

type Range struct {
	SinceRef     string
	UntilRef     string
	IncludeStart bool
	IncludeEnd   bool
}

type Reference

type Reference struct {
	Commit string
	Tags   []string
}

type Tag

type Tag struct {
	Name      string
	Timestamp time.Time
	Commit    string
	Annotated bool
}

func SearchForTag

func SearchForTag(repoPath, tagRef string) (*Tag, error)

func TagsFromLocal

func TagsFromLocal(repoPath string) ([]Tag, error)

Jump to

Keyboard shortcuts

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