aboutsummaryrefslogtreecommitdiff
path: root/internal/route/repo/commit.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/route/repo/commit.go')
-rw-r--r--internal/route/repo/commit.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/internal/route/repo/commit.go b/internal/route/repo/commit.go
index e8ff3380..00be5b1a 100644
--- a/internal/route/repo/commit.go
+++ b/internal/route/repo/commit.go
@@ -152,16 +152,18 @@ func Diff(c *context.Context) {
c.Data["Username"] = userName
c.Data["Reponame"] = repoName
c.Data["IsImageFile"] = commit.IsImageFile
+ c.Data["IsImageFileByIndex"] = commit.IsImageFileByIndex
c.Data["Commit"] = commit
c.Data["Author"] = db.ValidateCommitWithEmail(commit)
c.Data["Diff"] = diff
c.Data["Parents"] = parents
c.Data["DiffNotAvailable"] = diff.NumFiles() == 0
c.Data["SourcePath"] = conf.Server.Subpath + "/" + path.Join(userName, repoName, "src", commitID)
+ c.Data["RawPath"] = conf.Server.Subpath + "/" + path.Join(userName, repoName, "raw", commitID)
if commit.ParentsCount() > 0 {
c.Data["BeforeSourcePath"] = conf.Server.Subpath + "/" + path.Join(userName, repoName, "src", parents[0])
+ c.Data["BeforeRawPath"] = conf.Server.Subpath + "/" + path.Join(userName, repoName, "raw", parents[0])
}
- c.Data["RawPath"] = conf.Server.Subpath + "/" + path.Join(userName, repoName, "raw", commitID)
c.Success(DIFF)
}
@@ -213,12 +215,14 @@ func CompareDiff(c *context.Context) {
c.Data["Username"] = userName
c.Data["Reponame"] = repoName
c.Data["IsImageFile"] = commit.IsImageFile
+ c.Data["IsImageFileByIndex"] = commit.IsImageFileByIndex
c.Data["Title"] = "Comparing " + tool.ShortSHA1(beforeCommitID) + "..." + tool.ShortSHA1(afterCommitID) + " ยท " + userName + "/" + repoName
c.Data["Commit"] = commit
c.Data["Diff"] = diff
c.Data["DiffNotAvailable"] = diff.NumFiles() == 0
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.Data["BeforeSourcePath"] = conf.Server.Subpath + "/" + path.Join(userName, repoName, "src", beforeCommitID)
+ c.Data["BeforeRawPath"] = conf.Server.Subpath + "/" + path.Join(userName, repoName, "raw", beforeCommitID)
c.Success(DIFF)
}