Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrEmptyComparsion = errors.New("no objects to compare, both are empty")
ErrEmptyComparison is used when both src and dst are EmptyObjects
Functions ¶
This section is empty.
Types ¶
type Differ ¶
type Differ interface {
// Diff writes a generated patch to out for the diff between a and b.
Diff(out io.Writer, a io.ReadSeeker, b io.ReadSeeker) error
}
Differ supplies a stream-based diffing algorithm implementation.
func DefaultDiffer ¶
func DefaultDiffer() Differ
DefaultDiffer returns a diffmatchpatch-based differ.
type Object ¶
type Object struct {
io.ReadSeeker
// ID is the sha1 of the object
ID [20]byte
// Path is the root-relative path of the object
Path string
// Mode is the entry mode of the object
Mode int
}
Object is the minimum representation for generating diffs with git-style headers.
var EmptyObject Object
EmptyObject can be used when there is no corresponding src or dst entry, such as during deletions or creations.
type Writer ¶
Writer writes diffs using a given Differ including git-style headers between each patch.
func (*Writer) WriteDiff ¶
func (w *Writer) WriteDiff(a, b io.ReadSeeker) error
WriteDiff performs a Diff between a and b and writes only the resulting diff. It does not write the header.
func (*Writer) WriteHeader ¶
WriteHeader writes only the header for the comparison between the src and dst Objects.
Directories
¶
| Path | Synopsis |
|---|---|
|
This package implements the diff.Differ interface using github.com/mb0/diff as a backend.
|
This package implements the diff.Differ interface using github.com/mb0/diff as a backend. |
|
This package implements the diff.Differ interface using diffmatchpatch as a backend
|
This package implements the diff.Differ interface using diffmatchpatch as a backend |
|
This package implements the diff.Differ interface using github.com/mb0/diff as a backend.
|
This package implements the diff.Differ interface using github.com/mb0/diff as a backend. |