File tree Expand file tree Collapse file tree 4 files changed +15
-3
lines changed
templates/repo/issue/view_content Expand file tree Collapse file tree 4 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -944,6 +944,7 @@ pulls.tab_conversation = Conversation
944944pulls.tab_commits = Commits
945945pulls.tab_files = Files Changed
946946pulls.reopen_to_merge = Please reopen this pull request to perform a merge.
947+ pulls.cant_reopen_deleted_branch = This pull request cannot be reopened because the branch was deleted.
947948pulls.merged = Merged
948949pulls.has_merged = The pull request has been merged.
949950pulls.title_wip_desc = `<a href=" # ">Start the title with <strong>%s</strong></a> to prevent the pull request from being merged accidentally.`
Original file line number Diff line number Diff line change @@ -674,6 +674,7 @@ func ViewIssue(ctx *context.Context) {
674674 PrepareMergedViewPullInfo (ctx , issue )
675675 } else {
676676 PrepareViewPullInfo (ctx , issue )
677+ ctx .Data ["DisableStatusChange" ] = ctx .Data ["IsPullRequestBroken" ] == true && issue .IsClosed
677678 }
678679 if ctx .Written () {
679680 return
Original file line number Diff line number Diff line change @@ -999,8 +999,8 @@ func CleanUpPullRequest(ctx *context.Context) {
999999
10001000 pr := issue .PullRequest
10011001
1002- // Allow cleanup only for merged PR
1003- if ! pr .HasMerged {
1002+ // Don't cleanup unmerged and unclosed PRs
1003+ if ! pr .HasMerged && ! issue . IsClosed {
10041004 ctx .NotFound ("CleanUpPullRequest" , nil )
10051005 return
10061006 }
Original file line number Diff line number Diff line change 5858 {{end}}
5959 {{else if .Issue.IsClosed}}
6060 <div class="item text grey">
61- {{$.i18n.Tr "repo.pulls.reopen_to_merge"}}
61+ {{if .IsPullRequestBroken}}
62+ {{$.i18n.Tr "repo.pulls.cant_reopen_deleted_branch"}}
63+ {{else}}
64+ {{$.i18n.Tr "repo.pulls.reopen_to_merge"}}
65+ {{end}}
6266 </div>
67+ {{if .IsPullBranchDeletable}}
68+ <div class="ui divider"></div>
69+ <div>
70+ <a class="delete-button ui red button" href="" data-url="{{.DeleteBranchLink}}">{{$.i18n.Tr "repo.branch.delete" .HeadTarget}}</a>
71+ </div>
72+ {{end}}
6373 {{else if .IsPullFilesConflicted}}
6474 <div class="item text grey">
6575 <span class="octicon octicon-x"></span>
You can’t perform that action at this time.
0 commit comments