Reopen PR need retest patch
This commit is contained in:
parent
379629d28a
commit
c3ba5590c9
10 changed files with 171 additions and 135 deletions
|
@ -476,6 +476,11 @@ func ViewIssue(ctx *middleware.Context) {
|
|||
}
|
||||
|
||||
if issue.IsPull {
|
||||
if err = issue.GetPullRequest(); err != nil {
|
||||
ctx.Handle(500, "GetPullRequest", err)
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Data["PageIsPullList"] = true
|
||||
ctx.Data["PageIsPullConversation"] = true
|
||||
} else {
|
||||
|
@ -747,6 +752,12 @@ func NewComment(ctx *middleware.Context, form auth.CreateCommentForm) {
|
|||
}
|
||||
return
|
||||
}
|
||||
if issue.IsPull {
|
||||
if err = issue.GetPullRequest(); err != nil {
|
||||
ctx.Handle(500, "GetPullRequest", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
var attachments []string
|
||||
if setting.AttachmentEnabled {
|
||||
|
@ -766,6 +777,7 @@ func NewComment(ctx *middleware.Context, form auth.CreateCommentForm) {
|
|||
(form.Status == "reopen" || form.Status == "close") &&
|
||||
!(issue.IsPull && issue.HasMerged) {
|
||||
|
||||
// Duplication and conflict check should apply to reopen pull request.
|
||||
var pr *models.PullRequest
|
||||
|
||||
if form.Status == "reopen" && issue.IsPull {
|
||||
|
@ -777,6 +789,16 @@ func NewComment(ctx *middleware.Context, form auth.CreateCommentForm) {
|
|||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Regenerate patch and test conflict.
|
||||
if pr == nil {
|
||||
if err = issue.UpdatePatch(); err != nil {
|
||||
ctx.Handle(500, "UpdatePatch", err)
|
||||
return
|
||||
}
|
||||
|
||||
issue.AddToTaskQueue()
|
||||
}
|
||||
}
|
||||
|
||||
if pr != nil {
|
||||
|
|
|
@ -149,7 +149,10 @@ func checkPullInfo(ctx *middleware.Context) *models.Issue {
|
|||
if err = issue.GetPoster(); err != nil {
|
||||
ctx.Handle(500, "GetPoster", err)
|
||||
return nil
|
||||
} else if issue.GetHeadRepo(); err != nil {
|
||||
} else if err = issue.GetPullRequest(); err != nil {
|
||||
ctx.Handle(500, "GetPullRequest", err)
|
||||
return nil
|
||||
} else if err = issue.GetHeadRepo(); err != nil {
|
||||
ctx.Handle(500, "GetHeadRepo", err)
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue