diff

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diff

type Diff struct {
	FromID   string
	ToID     string
	OldMode  int32
	NewMode  int32
	FromPath []byte
	ToPath   []byte
	Binary   bool
	Status   byte
	Patch    []byte
}

Diff represents a single parsed diff entry

type Parser

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

Parser holds necessary state for parsing a diff stream

func NewDiffParser

func NewDiffParser(src io.Reader) *Parser

NewDiffParser returns a new Parser

func (*Parser) Diff

func (parser *Parser) Diff() *Diff

Diff returns a successfully parsed diff. It should be called only when Parser.Parse() returns true.

func (*Parser) Err

func (parser *Parser) Err() error

Err returns the error encountered (if any) when parsing the diff stream. It should be called only when Parser.Parse() returns false.

func (*Parser) Parse

func (parser *Parser) Parse() bool

Parse parses a single diff. It returns true if successful, false if it finished parsing all diffs or when it encounters an error, in which case use Parser.Err() to get the error.

Jump to

Keyboard shortcuts

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