Skip to content

Commit

Permalink
Update documentation for ParseMultiFileDiff
Browse files Browse the repository at this point in the history
  • Loading branch information
mrnugget committed Nov 6, 2019
1 parent 042635e commit 16e54d7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions diff/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import (
"sourcegraph.com/sqs/pbtypes"
)

// ParseMultiFileDiff parses a multi-file unified diff. It returns an error if parsing failed as a whole, but does its
// best to parse as many files in the case of per-file errors. In the case of non-fatal per-file errors, the error
// return value is null and the Errs field in the returned MultiFileDiff is set.
// ParseMultiFileDiff parses a multi-file unified diff. It returns an error if
// parsing failed as a whole, but does its best to parse as many files in the
// case of per-file errors. If it cannot detect when the diff of the next file
// begins, the hunks are added to the FileDiff of the previous file.
func ParseMultiFileDiff(diff []byte) ([]*FileDiff, error) {
return NewMultiFileDiffReader(bytes.NewReader(diff)).ReadAllFiles()
}
Expand Down

0 comments on commit 16e54d7

Please sign in to comment.