git

package
v0.0.0-...-6c6fd2d Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EmptyTreeCommitID is a hash representing empty tree
	EmptyTreeCommitID = "4b825dc642cb6eb9a060e54bf8d69288fbee4904"
)

Variables

This section is empty.

Functions

func CloneRepository

func CloneRepository(url *string, branch *string, depth int, auth transport.AuthMethod) (*git.Repository, string, error)

CloneRepository clones a repository from a remote source to local temp. dir.

func GatherPaths

func GatherPaths(dir, branch string, targets []string) ([]string, error)

GatherPaths gets all committed file paths

func GetChangeAction

func GetChangeAction(change *object.Change) string

GetChangeAction gets change action

func GetChangePath

func GetChangePath(change *object.Change) string

GetChangePath gets change path

func GetChanges

func GetChanges(commit *object.Commit, repo *git.Repository) (object.Changes, error)

GetChanges gets the changes since a commit till current HEAD

func GetLatestCommitHash

func GetLatestCommitHash(dir string) (string, error)

GetLatestCommitHash runs a git cmd to return latest commit hash

func GetParentCommit

func GetParentCommit(commit *object.Commit, repo *git.Repository) (*object.Commit, error)

GetParentCommit gets parent commit

func GetPatch

func GetPatch(change *object.Change) (*object.Patch, error)

GetPatch gets patch

func GetRepositoryHistory

func GetRepositoryHistory(repository *git.Repository) ([]*object.Commit, error)

GetRepositoryHistory gets commit history of a git repo.

Types

This section is empty.

Jump to

Keyboard shortcuts

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