Versions in this module Expand all Collapse all v1 v1.0.1 Jan 23, 2024 Changes in this version + func Apply(dst io.Writer, src io.ReaderAt, f *File) error + func ParsePatchDate(s string) (time.Time, error) + type ApplyError struct + Fragment int + FragmentLine int + Line int64 + func (e *ApplyError) Error() string + func (e *ApplyError) Unwrap() error + type BinaryApplier struct + func NewBinaryApplier(dst io.Writer, src io.ReaderAt) *BinaryApplier + func (a *BinaryApplier) ApplyFragment(f *BinaryFragment) error + func (a *BinaryApplier) Close() (err error) + type BinaryFragment struct + Data []byte + Method BinaryPatchMethod + Size int64 + type BinaryPatchMethod int + const BinaryPatchDelta + const BinaryPatchLiteral + type Conflict struct + func (c *Conflict) Error() string + func (c *Conflict) Is(other error) bool + type File struct + BinaryFragment *BinaryFragment + IsBinary bool + IsCopy bool + IsDelete bool + IsNew bool + IsRename bool + NewMode os.FileMode + NewName string + NewOIDPrefix string + OldMode os.FileMode + OldName string + OldOIDPrefix string + ReverseBinaryFragment *BinaryFragment + Score int + TextFragments []*TextFragment + func Parse(r io.Reader) ([]*File, string, error) + type Line struct + Line string + Op LineOp + func (fl Line) New() bool + func (fl Line) NoEOL() bool + func (fl Line) Old() bool + func (fl Line) String() string + type LineOp int + const OpAdd + const OpContext + const OpDelete + func (op LineOp) String() string + type LineReaderAt interface + ReadLinesAt func(lines [][]byte, offset int64) (n int, err error) + type PatchHeader struct + Author *PatchIdentity + AuthorDate time.Time + Body string + BodyAppendix string + Committer *PatchIdentity + CommitterDate time.Time + SHA string + SubjectPrefix string + Title string + func ParsePatchHeader(header string, options ...PatchHeaderOption) (*PatchHeader, error) + func (h *PatchHeader) Message() string + type PatchHeaderOption func(*patchHeaderOptions) + func WithSubjectCleanMode(m SubjectCleanMode) PatchHeaderOption + type PatchIdentity struct + Email string + Name string + func ParsePatchIdentity(s string) (PatchIdentity, error) + func (i PatchIdentity) String() string + type SubjectCleanMode int + const SubjectCleanAll + const SubjectCleanPatchOnly + const SubjectCleanWhitespace + type TextApplier struct + func NewTextApplier(dst io.Writer, src io.ReaderAt) *TextApplier + func (a *TextApplier) ApplyFragment(f *TextFragment) error + func (a *TextApplier) Close() (err error) + type TextFragment struct + Comment string + LeadingContext int64 + Lines []Line + LinesAdded int64 + LinesDeleted int64 + NewLines int64 + NewPosition int64 + OldLines int64 + OldPosition int64 + TrailingContext int64 + func (f *TextFragment) Header() string + func (f *TextFragment) Validate() error