aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/commit.go
diff options
context:
space:
mode:
authorlunnyxiao <xiaolunwen@gmail.com>2014-09-17 12:03:03 +0800
committerlunnyxiao <xiaolunwen@gmail.com>2014-09-17 12:03:03 +0800
commited84adb679f3de70b2bffaead20a87711c38ee3a (patch)
treeff303000a735b237c8f45bbcc8018da185beb114 /routers/repo/commit.go
parentefb68a0a96574a334a3ec791c0a7f2bc6b96d006 (diff)
downloadgitea-ed84adb679f3de70b2bffaead20a87711c38ee3a.tar.gz
gitea-ed84adb679f3de70b2bffaead20a87711c38ee3a.zip
toutf8 improved & add max git diff lines
Diffstat (limited to 'routers/repo/commit.go')
-rw-r--r--routers/repo/commit.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/routers/repo/commit.go b/routers/repo/commit.go
index 54acc85b3e..f7feb4d95e 100644
--- a/routers/repo/commit.go
+++ b/routers/repo/commit.go
@@ -12,6 +12,7 @@ import (
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/middleware"
+ "github.com/gogits/gogs/modules/setting"
)
const (
@@ -114,7 +115,8 @@ func Diff(ctx *middleware.Context) {
commit := ctx.Repo.Commit
- diff, err := models.GetDiffCommit(models.RepoPath(userName, repoName), commitId)
+ diff, err := models.GetDiffCommit(models.RepoPath(userName, repoName),
+ commitId, setting.MaxGitDiffLines)
if err != nil {
ctx.Handle(404, "GetDiffCommit", err)
return
@@ -176,7 +178,8 @@ func CompareDiff(ctx *middleware.Context) {
return
}
- diff, err := models.GetDiffRange(models.RepoPath(userName, repoName), beforeCommitId, afterCommitId)
+ diff, err := models.GetDiffRange(models.RepoPath(userName, repoName), beforeCommitId,
+ afterCommitId, setting.MaxGitDiffLines)
if err != nil {
ctx.Handle(404, "GetDiffRange", err)
return