Skip to content

Commit

Permalink
Merge pull request #36 from sourcegraph/missing-extended-header
Browse files Browse the repository at this point in the history
Update documentation for ParseMultiFileDiff
  • Loading branch information
mrnugget committed Nov 7, 2019
2 parents 042635e + 16e54d7 commit 3637c60
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions diff/parse.go
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 3637c60

Please sign in to comment.