Move git diff codes from models to services/gitdiff (#7889)

* move git diff codes from models to services/gitdiff

* fix template

* fix test

* fix template
This commit is contained in:
Lunny Xiao 2019-09-06 10:20:09 +08:00 committed by techknowlogick
parent b660a732ae
commit c03d75fbd5
15 changed files with 164 additions and 111 deletions

View file

@ -13,6 +13,7 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/notification"
pull_service "code.gitea.io/gitea/modules/pull"
comment_service "code.gitea.io/gitea/services/comments"
)
// CreateCodeComment will create a code comment including an pending review if required
@ -69,7 +70,7 @@ func CreateCodeComment(ctx *context.Context, form auth.CodeCommentForm) {
review.ID = form.Reply
}
//FIXME check if line, commit and treepath exist
comment, err := models.CreateCodeComment(
comment, err := comment_service.CreateCodeComment(
ctx.User,
issue.Repo,
issue,