git

package
v0.74.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GitExec

func GitExec(args ...string) (string, error)

func GitExecInDir

func GitExecInDir(dir string, args ...string) (string, error)

Types

type Client added in v0.74.0

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

func InitClient added in v0.74.0

func InitClient(gitPath string) (*Client, error)

func (*Client) GetFirstCommit added in v0.74.0

func (gc *Client) GetFirstCommit(path string) (Commit, error)

func (*Client) GetLastCommit added in v0.74.0

func (gc *Client) GetLastCommit(path string) (Commit, error)

Gets the last commit that modified the file

func (*Client) GitExec added in v0.74.0

func (gc *Client) GitExec(args ...string) (string, error)

func (*Client) GitExecInDir added in v0.74.0

func (gc *Client) GitExecInDir(dir string, args ...string) (string, error)

type Commit

type Commit struct {
	SHA    string
	Date   string
	Author string
}

func GetFirstCommit

func GetFirstCommit(path string) (Commit, error)

func GetLastCommit

func GetLastCommit(path string) (Commit, error)

type GitClient added in v0.74.0

type GitClient interface {
	GetFirstCommit(path string) (Commit, error)
	GetLastCommit(path string) (Commit, error)
	GitExec(args ...string) (string, error)
	GitExecInDir(dir string, args ...string) (string, error)
}
var (
	GlobalGitClient GitClient
)

Jump to

Keyboard shortcuts

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