diff

package
v0.0.0-...-4681efc Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: Unlicense Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	LineOperationModify = LineOperation('M')
	LineOperationAdd    = LineOperation('A')
	LineOperationDelete = LineOperation('D')
)
View Source
const (
	StatusAdd        = StatusType('A')
	StatusCopy       = StatusType('C')
	StatusDelete     = StatusType('D')
	StatusModify     = StatusType('M')
	StatusRename     = StatusType('R')
	StatusChangeType = StatusType('T')
	StatusUnmerged   = StatusType('U')
	StatusUnknown    = StatusType('X')
)

Variables

View Source
var (
	ErrMalformedDiff       = errors.New("malformed diff")
	ErrUnknownStatusLetter = fmt.Errorf("%w: invalid status letter", ErrMalformedDiff)
)

Functions

This section is empty.

Types

type Diff

type Diff struct {
	Status   Status
	Lines    []*Line
	Src      State
	Dst      State
	IsBinary bool
}

func Calculate

func Calculate(
	ctx context.Context,
	repoPath string,
	commitA, commitB string,
) ([]*Diff, error)

type Line

type Line struct {
	Operation LineOperation
	Src       LineState
	Dst       LineState
}

type LineOperation

type LineOperation rune

type LineState

type LineState struct {
	Number  int64
	Content string
}

type Mode

type Mode uint32

type State

type State struct {
	Mode Mode
	SHA1 []byte
	Path string
}

type Status

type Status struct {
	Type  StatusType
	Score *int
}

type StatusType

type StatusType rune

Jump to

Keyboard shortcuts

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