mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	toutf8 improved & add max git diff lines
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user