|
|
@ -253,6 +253,9 @@ func Diff(ctx *middleware.Context) { |
|
|
|
ctx.Data["Parents"] = parents |
|
|
|
ctx.Data["Parents"] = parents |
|
|
|
ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0 |
|
|
|
ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0 |
|
|
|
ctx.Data["SourcePath"] = setting.AppSubUrl + "/" + path.Join(userName, repoName, "src", commitId) |
|
|
|
ctx.Data["SourcePath"] = setting.AppSubUrl + "/" + path.Join(userName, repoName, "src", commitId) |
|
|
|
|
|
|
|
if (commit.ParentCount() > 0) { |
|
|
|
|
|
|
|
ctx.Data["BeforeSourcePath"] = setting.AppSubUrl + "/" + path.Join(userName, repoName, "src", parents[0]) |
|
|
|
|
|
|
|
} |
|
|
|
ctx.Data["RawPath"] = setting.AppSubUrl + "/" + path.Join(userName, repoName, "raw", commitId) |
|
|
|
ctx.Data["RawPath"] = setting.AppSubUrl + "/" + path.Join(userName, repoName, "raw", commitId) |
|
|
|
ctx.HTML(200, DIFF) |
|
|
|
ctx.HTML(200, DIFF) |
|
|
|
} |
|
|
|
} |
|
|
@ -316,6 +319,7 @@ func CompareDiff(ctx *middleware.Context) { |
|
|
|
ctx.Data["Diff"] = diff |
|
|
|
ctx.Data["Diff"] = diff |
|
|
|
ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0 |
|
|
|
ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0 |
|
|
|
ctx.Data["SourcePath"] = setting.AppSubUrl + "/" + path.Join(userName, repoName, "src", afterCommitId) |
|
|
|
ctx.Data["SourcePath"] = setting.AppSubUrl + "/" + path.Join(userName, repoName, "src", afterCommitId) |
|
|
|
|
|
|
|
ctx.Data["BeforeSourcePath"] = setting.AppSubUrl + "/" + path.Join(userName, repoName, "src", beforeCommitId) |
|
|
|
ctx.Data["RawPath"] = setting.AppSubUrl + "/" + path.Join(userName, repoName, "raw", afterCommitId) |
|
|
|
ctx.Data["RawPath"] = setting.AppSubUrl + "/" + path.Join(userName, repoName, "raw", afterCommitId) |
|
|
|
ctx.HTML(200, DIFF) |
|
|
|
ctx.HTML(200, DIFF) |
|
|
|
} |
|
|
|
} |
|
|
|