git

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentBranch

func CurrentBranch(cmd CommandRunner) (string, error)

func HeadCommit

func HeadCommit(cmd CommandRunner) (string, error)

func RunGit

func RunGit(args ...string) (content []byte, err error)

Types

type CommandRunner

type CommandRunner func(args ...string) ([]byte, error)

type CommitRangeResults

type CommitRangeResults struct {
	From string
	To   string
}

func CommitRange

func CommitRange(cmd CommandRunner, baseBranch string) (cr CommitRangeResults, err error)

func (CommitRangeResults) String

func (gcr CommitRangeResults) String() string

type FileBlames

type FileBlames map[string]LineBlames

type LineBlame

type LineBlame struct {
	Filename string
	Line     int
	Commit   string
}

type LineBlames

type LineBlames []LineBlame

func Blame

func Blame(path string, cmd CommandRunner) (lines LineBlames, err error)

func (LineBlames) GetCommit

func (lbs LineBlames) GetCommit(line int) string

Jump to

Keyboard shortcuts

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