|
|
@ -292,6 +292,13 @@ func CompareDiff(ctx *context.Context) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ctx.Data["PageIsComparePull"] == true {
|
|
|
|
if ctx.Data["PageIsComparePull"] == true {
|
|
|
|
|
|
|
|
headBranches, err := headGitRepo.GetBranches()
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
ctx.ServerError("GetBranches", err)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ctx.Data["HeadBranches"] = headBranches
|
|
|
|
|
|
|
|
|
|
|
|
pr, err := models.GetUnmergedPullRequest(headRepo.ID, ctx.Repo.Repository.ID, headBranch, baseBranch)
|
|
|
|
pr, err := models.GetUnmergedPullRequest(headRepo.ID, ctx.Repo.Repository.ID, headBranch, baseBranch)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
if !models.IsErrPullRequestNotExist(err) {
|
|
|
|
if !models.IsErrPullRequestNotExist(err) {
|
|
|
@ -312,13 +319,6 @@ func CompareDiff(ctx *context.Context) {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
headBranches, err := headGitRepo.GetBranches()
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
ctx.ServerError("GetBranches", err)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ctx.Data["HeadBranches"] = headBranches
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
beforeCommitID := ctx.Data["BeforeCommitID"].(string)
|
|
|
|
beforeCommitID := ctx.Data["BeforeCommitID"].(string)
|
|
|
|
afterCommitID := ctx.Data["AfterCommitID"].(string)
|
|
|
|
afterCommitID := ctx.Data["AfterCommitID"].(string)
|
|
|
|