git

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 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

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

TODO: put under test

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

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

func New

func New(repoPath string) (Interface, error)

type MockInterface

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

func (MockInterface) CommitsBetween

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

func (MockInterface) HeadTag

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

func (MockInterface) HeadTagOrCommit

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

func (MockInterface) RemoteURL

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

func (MockInterface) SearchForTag

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

func (MockInterface) TagsFromLocal

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

type Range

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
}

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