diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-08-22 12:52:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-22 12:52:40 +0800 |
commit | 111d31d6810c6a1336db6897b8cf1b249f5d709a (patch) | |
tree | 0cd182f15b6fbb511542ceb5fc495dea2dfe9329 /models | |
parent | 09ca3912301eb77e4f30c80753fbe0f0735dc5f2 (diff) | |
download | gitea-111d31d6810c6a1336db6897b8cf1b249f5d709a.tar.gz gitea-111d31d6810c6a1336db6897b8cf1b249f5d709a.zip |
don't convert buffer to string (#7115)
Diffstat (limited to 'models')
-rw-r--r-- | models/issue_comment.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/models/issue_comment.go b/models/issue_comment.go index 3a94a6b5be..7eb13ed7af 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, |