Skip to content

Commit 13e8639

Browse files
committed
Clarify that Parse expects a single patch
1 parent 981bc4b commit 13e8639

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

gitdiff/parser.go

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ import (
1212
// Parse parses a patch with changes to one or more files. Any content before
1313
// the first file is returned as the second value. If an error occurs while
1414
// parsing, it returns all files parsed before the error.
15+
//
16+
// Parse expects to receive a single patch. If the input may contain multiple
17+
// patches (for example, if it is an mbox file), callers should split it into
18+
// individual patches and call Parse on each one.
1519
func Parse(r io.Reader) ([]*File, string, error) {
1620
p := newParser(r)
1721

0 commit comments

Comments
 (0)