From 16e54d7ae58bca5ae06518775d0666978ffb7193 Mon Sep 17 00:00:00 2001 From: Thorsten Ball Date: Wed, 6 Nov 2019 17:08:46 +0100 Subject: [PATCH] Update documentation for ParseMultiFileDiff --- diff/parse.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/diff/parse.go b/diff/parse.go index 1e77df4..f525c64 100644 --- a/diff/parse.go +++ b/diff/parse.go @@ -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() }