Skip to content

Commit 6765cc6

Browse files
committed
Add comment to BinaryFragment.String
1 parent 9d2fdae commit 6765cc6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gitdiff/gitdiff.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type File struct {
4141

4242
// String returns a git diff representation of this file. The value can be
4343
// parsed by this library to obtain the same File, but may not be the same as
44-
// the original input or the same as what Git would produces
44+
// the original input.
4545
func (f *File) String() string {
4646
var diff strings.Builder
4747
newFormatter(&diff).FormatFile(f)
@@ -219,6 +219,10 @@ const (
219219
BinaryPatchLiteral
220220
)
221221

222+
// String returns a git diff format of this fragment. Due to differences in
223+
// zlib implementation between Go and Git, encoded binary data in the result
224+
// will likely differ from what Git produces for the same input. See
225+
// [File.String] for more details on this format.
222226
func (f *BinaryFragment) String() string {
223227
var diff strings.Builder
224228
newFormatter(&diff).FormatBinaryFragment(f)

0 commit comments

Comments
 (0)