|
@@ -148,9 +148,14 @@ func Diff(ctx *context.Context) {
|
|
|
|
|
|
userName := ctx.Repo.Owner.Name
|
|
userName := ctx.Repo.Owner.Name
|
|
repoName := ctx.Repo.Repository.Name
|
|
repoName := ctx.Repo.Repository.Name
|
|
- commitID := ctx.Repo.CommitID
|
|
|
|
|
|
+ commitID := ctx.Params(":sha")
|
|
|
|
+
|
|
|
|
+ commit, err := ctx.Repo.GitRepo.GetCommit(commitID)
|
|
|
|
+ if err != nil {
|
|
|
|
+ ctx.Handle(500, "Repo.GitRepo.GetCommit", err)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
|
|
- commit := ctx.Repo.Commit
|
|
|
|
diff, err := models.GetDiffCommit(models.RepoPath(userName, repoName),
|
|
diff, err := models.GetDiffCommit(models.RepoPath(userName, repoName),
|
|
commitID, setting.Git.MaxGitDiffLines)
|
|
commitID, setting.Git.MaxGitDiffLines)
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -168,6 +173,7 @@ func Diff(ctx *context.Context) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ ctx.Data["CommitID"] = commitID
|
|
ctx.Data["IsSplitStyle"] = ctx.Query("style") == "split"
|
|
ctx.Data["IsSplitStyle"] = ctx.Query("style") == "split"
|
|
ctx.Data["Username"] = userName
|
|
ctx.Data["Username"] = userName
|
|
ctx.Data["Reponame"] = repoName
|
|
ctx.Data["Reponame"] = repoName
|
|
@@ -187,6 +193,10 @@ func Diff(ctx *context.Context) {
|
|
ctx.HTML(200, DIFF)
|
|
ctx.HTML(200, DIFF)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+func RawDiff(ctx *context.Context) {
|
|
|
|
+ panic("not implemented")
|
|
|
|
+}
|
|
|
|
+
|
|
func CompareDiff(ctx *context.Context) {
|
|
func CompareDiff(ctx *context.Context) {
|
|
ctx.Data["IsRepoToolbarCommits"] = true
|
|
ctx.Data["IsRepoToolbarCommits"] = true
|
|
ctx.Data["IsDiffCompare"] = true
|
|
ctx.Data["IsDiffCompare"] = true
|