diff options
author | Unknwon <u@gogs.io> | 2015-09-02 09:26:56 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-09-02 09:26:56 -0400 |
commit | 953bb06857f59f5c6987f68a08a94cf5a885b456 (patch) | |
tree | 196a45fa4e7f8808b35790981eb0e417bbfa1a61 /routers/repo/issue.go | |
parent | 6ea28f2a4759c5192811b12de054e7ad62f080f6 (diff) |
basic PR feature
Diffstat (limited to 'routers/repo/issue.go')
-rw-r--r-- | routers/repo/issue.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go index d51354a4..63198687 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -466,7 +466,12 @@ func ViewIssue(ctx *middleware.Context) { // Get more information if it's a pull request. if issue.IsPull { - PrepareViewPullInfo(ctx, issue) + if issue.HasMerged { + ctx.Data["DisableStatusChange"] = issue.HasMerged + PrepareMergedViewPullInfo(ctx, issue) + } else { + PrepareViewPullInfo(ctx, issue) + } if ctx.Written() { return } @@ -730,7 +735,8 @@ func NewComment(ctx *middleware.Context, form auth.CreateCommentForm) { // Check if issue owner/poster changes the status of issue. if (ctx.Repo.IsOwner() || (ctx.IsSigned && issue.IsPoster(ctx.User.Id))) && - (form.Status == "reopen" || form.Status == "close") { + (form.Status == "reopen" || form.Status == "close") && + !(issue.IsPull && issue.HasMerged) { issue.Repo = ctx.Repo.Repository if err = issue.ChangeStatus(ctx.User, form.Status == "close"); err != nil { ctx.Handle(500, "ChangeStatus", err) |