Skip to content

Commit c2035ad

Browse files
authored
Add Apply convenience function to match Parse (#5)
1 parent 34ea173 commit c2035ad

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

gitdiff/apply.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ const (
9898
applyFile
9999
)
100100

101+
// Apply is a convenience function that creates an Applier for src with default
102+
// settings and applies the changes in f, writing the result to dst.
103+
func Apply(dst io.Writer, src io.ReaderAt, f *File) error {
104+
return NewApplier(src).ApplyFile(dst, f)
105+
}
106+
101107
// Applier applies changes described in fragments to source data. If changes
102108
// are described in multiple fragments, those fragments must be applied in
103109
// order, usually by calling ApplyFile.

0 commit comments

Comments
 (0)