diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-09-06 10:20:09 +0800 |
---|---|---|
committer | techknowlogick <techknowlogick@gitea.io> | 2019-09-05 22:20:09 -0400 |
commit | c03d75fbd51174d0e7ffdbaf9e9e253438d06cf7 (patch) | |
tree | a54e9fdfb6ff96baf7010d7fd5049a05a16644e2 /routers/repo/commit.go | |
parent | b660a732ae283d863636ead9cc1a365ce1c0edc1 (diff) | |
download | gitea-c03d75fbd51174d0e7ffdbaf9e9e253438d06cf7.tar.gz gitea-c03d75fbd51174d0e7ffdbaf9e9e253438d06cf7.zip |
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
Diffstat (limited to 'routers/repo/commit.go')
-rw-r--r-- | routers/repo/commit.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/routers/repo/commit.go b/routers/repo/commit.go index 79fa024dc9..c3181cbe46 100644 --- a/routers/repo/commit.go +++ b/routers/repo/commit.go @@ -16,6 +16,7 @@ import ( "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" + "code.gitea.io/gitea/services/gitdiff" ) const ( @@ -217,7 +218,7 @@ func Diff(ctx *context.Context) { ctx.Data["CommitStatus"] = models.CalcCommitStatus(statuses) - diff, err := models.GetDiffCommit(models.RepoPath(userName, repoName), + diff, err := gitdiff.GetDiffCommit(models.RepoPath(userName, repoName), commitID, setting.Git.MaxGitDiffLines, setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles) if err != nil { @@ -269,10 +270,10 @@ func Diff(ctx *context.Context) { // RawDiff dumps diff results of repository in given commit ID to io.Writer func RawDiff(ctx *context.Context) { - if err := models.GetRawDiff( + if err := gitdiff.GetRawDiff( models.RepoPath(ctx.Repo.Owner.Name, ctx.Repo.Repository.Name), ctx.Params(":sha"), - models.RawDiffType(ctx.Params(":ext")), + gitdiff.RawDiffType(ctx.Params(":ext")), ctx.Resp, ); err != nil { ctx.ServerError("GetRawDiff", err) |