diff options
Diffstat (limited to 'internal/route/repo/commit.go')
-rw-r--r-- | internal/route/repo/commit.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/internal/route/repo/commit.go b/internal/route/repo/commit.go index e058afc4..95075fb6 100644 --- a/internal/route/repo/commit.go +++ b/internal/route/repo/commit.go @@ -10,9 +10,9 @@ import ( "github.com/gogs/git-module" + "gogs.io/gogs/internal/conf" "gogs.io/gogs/internal/context" "gogs.io/gogs/internal/db" - "gogs.io/gogs/internal/setting" "gogs.io/gogs/internal/tool" ) @@ -135,8 +135,8 @@ func Diff(c *context.Context) { } diff, err := db.GetDiffCommit(db.RepoPath(userName, repoName), - commitID, setting.Git.MaxGitDiffLines, - setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles) + commitID, conf.Git.MaxGitDiffLines, + conf.Git.MaxGitDiffLineCharacters, conf.Git.MaxGitDiffFiles) if err != nil { c.NotFoundOrServerError("get diff commit", git.IsErrNotExist, err) return @@ -168,11 +168,11 @@ func Diff(c *context.Context) { c.Data["Diff"] = diff c.Data["Parents"] = parents c.Data["DiffNotAvailable"] = diff.NumFiles() == 0 - c.Data["SourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", commitID) + c.Data["SourcePath"] = conf.Server.Subpath + "/" + path.Join(userName, repoName, "src", commitID) if commit.ParentCount() > 0 { - c.Data["BeforeSourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", parents[0]) + c.Data["BeforeSourcePath"] = conf.Server.Subpath + "/" + path.Join(userName, repoName, "src", parents[0]) } - c.Data["RawPath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "raw", commitID) + c.Data["RawPath"] = conf.Server.Subpath + "/" + path.Join(userName, repoName, "raw", commitID) c.Success(DIFF) } @@ -202,8 +202,8 @@ func CompareDiff(c *context.Context) { } diff, err := db.GetDiffRange(db.RepoPath(userName, repoName), beforeCommitID, - afterCommitID, setting.Git.MaxGitDiffLines, - setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles) + afterCommitID, conf.Git.MaxGitDiffLines, + conf.Git.MaxGitDiffLineCharacters, conf.Git.MaxGitDiffFiles) if err != nil { c.Handle(404, "GetDiffRange", err) return @@ -229,8 +229,8 @@ func CompareDiff(c *context.Context) { c.Data["Commit"] = commit c.Data["Diff"] = diff c.Data["DiffNotAvailable"] = diff.NumFiles() == 0 - c.Data["SourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", afterCommitID) - c.Data["BeforeSourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", beforeCommitID) - c.Data["RawPath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "raw", afterCommitID) + c.Data["SourcePath"] = conf.Server.Subpath + "/" + path.Join(userName, repoName, "src", afterCommitID) + c.Data["BeforeSourcePath"] = conf.Server.Subpath + "/" + path.Join(userName, repoName, "src", beforeCommitID) + c.Data["RawPath"] = conf.Server.Subpath + "/" + path.Join(userName, repoName, "raw", afterCommitID) c.HTML(200, DIFF) } |