|
|
@ -242,8 +242,11 @@ func ViewPullCommits(ctx *context.Context) { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
pull := issue.PullRequest |
|
|
|
pull := issue.PullRequest |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if pull.HeadRepo != nil { |
|
|
|
ctx.Data["Username"] = pull.HeadUserName |
|
|
|
ctx.Data["Username"] = pull.HeadUserName |
|
|
|
ctx.Data["Reponame"] = pull.HeadRepo.Name |
|
|
|
ctx.Data["Reponame"] = pull.HeadRepo.Name |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var commits *list.List |
|
|
|
var commits *list.List |
|
|
|
if pull.HasMerged { |
|
|
|
if pull.HasMerged { |
|
|
@ -362,16 +365,21 @@ func ViewPullFiles(ctx *context.Context) { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
headTarget := path.Join(pull.HeadUserName, pull.HeadRepo.Name) |
|
|
|
|
|
|
|
ctx.Data["IsSplitStyle"] = ctx.Query("style") == "split" |
|
|
|
ctx.Data["IsSplitStyle"] = ctx.Query("style") == "split" |
|
|
|
|
|
|
|
ctx.Data["IsImageFile"] = commit.IsImageFile |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// It is possible head repo has been deleted for merged pull requests
|
|
|
|
|
|
|
|
if pull.HeadRepo != nil { |
|
|
|
ctx.Data["Username"] = pull.HeadUserName |
|
|
|
ctx.Data["Username"] = pull.HeadUserName |
|
|
|
ctx.Data["Reponame"] = pull.HeadRepo.Name |
|
|
|
ctx.Data["Reponame"] = pull.HeadRepo.Name |
|
|
|
ctx.Data["IsImageFile"] = commit.IsImageFile |
|
|
|
|
|
|
|
|
|
|
|
headTarget := path.Join(pull.HeadUserName, pull.HeadRepo.Name) |
|
|
|
ctx.Data["SourcePath"] = setting.AppSubUrl + "/" + path.Join(headTarget, "src", endCommitID) |
|
|
|
ctx.Data["SourcePath"] = setting.AppSubUrl + "/" + path.Join(headTarget, "src", endCommitID) |
|
|
|
ctx.Data["BeforeSourcePath"] = setting.AppSubUrl + "/" + path.Join(headTarget, "src", startCommitID) |
|
|
|
ctx.Data["BeforeSourcePath"] = setting.AppSubUrl + "/" + path.Join(headTarget, "src", startCommitID) |
|
|
|
ctx.Data["RawPath"] = setting.AppSubUrl + "/" + path.Join(headTarget, "raw", endCommitID) |
|
|
|
ctx.Data["RawPath"] = setting.AppSubUrl + "/" + path.Join(headTarget, "raw", endCommitID) |
|
|
|
ctx.Data["RequireHighlightJS"] = true |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ctx.Data["RequireHighlightJS"] = true |
|
|
|
ctx.HTML(200, PULL_FILES) |
|
|
|
ctx.HTML(200, PULL_FILES) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -387,11 +395,7 @@ func MergePullRequest(ctx *context.Context) { |
|
|
|
|
|
|
|
|
|
|
|
pr, err := models.GetPullRequestByIssueID(issue.ID) |
|
|
|
pr, err := models.GetPullRequestByIssueID(issue.ID) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
if models.IsErrPullRequestNotExist(err) { |
|
|
|
ctx.NotFoundOrServerError("GetPullRequestByIssueID", models.IsErrPullRequestNotExist, err) |
|
|
|
ctx.Handle(404, "GetPullRequestByIssueID", nil) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
ctx.Handle(500, "GetPullRequestByIssueID", err) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|