From 111d31d6810c6a1336db6897b8cf1b249f5d709a Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 22 Aug 2019 12:52:40 +0800 Subject: [PATCH] don't convert buffer to string (#7115) --- models/issue_comment.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/issue_comment.go b/models/issue_comment.go index 3a94a6b5bed5..7eb13ed7af26 100644 --- a/models/issue_comment.go +++ b/models/issue_comment.go @@ -910,7 +910,7 @@ func CreateCodeComment(doer *User, repo *Repository, issue *Issue, content, tree if err := GetRawDiffForFile(gitRepo.Path, pr.MergeBase, headCommitID, RawDiffNormal, treePath, patchBuf); err != nil { return nil, fmt.Errorf("GetRawDiffForLine[%s, %s, %s, %s]: %v", err, gitRepo.Path, pr.MergeBase, headCommitID, treePath) } - patch = CutDiffAroundLine(strings.NewReader(patchBuf.String()), int64((&Comment{Line: line}).UnsignedLine()), line < 0, setting.UI.CodeCommentLines) + patch = CutDiffAroundLine(patchBuf, int64((&Comment{Line: line}).UnsignedLine()), line < 0, setting.UI.CodeCommentLines) } return CreateComment(&CreateCommentOptions{ Type: CommentTypeCode,