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
944
944
pulls.tab_commits = Commits
945
945
pulls.tab_files = Files Changed
946
946
pulls.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.
947
948
pulls.merged = Merged
948
949
pulls.has_merged = The pull request has been merged.
949
950
pulls.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) {
674
674
PrepareMergedViewPullInfo (ctx , issue )
675
675
} else {
676
676
PrepareViewPullInfo (ctx , issue )
677
+ ctx .Data ["DisableStatusChange" ] = ctx .Data ["IsPullRequestBroken" ] == true && issue .IsClosed
677
678
}
678
679
if ctx .Written () {
679
680
return
Original file line number Diff line number Diff line change @@ -999,8 +999,8 @@ func CleanUpPullRequest(ctx *context.Context) {
999
999
1000
1000
pr := issue .PullRequest
1001
1001
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 {
1004
1004
ctx .NotFound ("CleanUpPullRequest" , nil )
1005
1005
return
1006
1006
}
Original file line number Diff line number Diff line change 58
58
{{end}}
59
59
{{else if .Issue.IsClosed}}
60
60
<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}}
62
66
</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}}
63
73
{{else if .IsPullFilesConflicted}}
64
74
<div class="item text grey">
65
75
<span class="octicon octicon-x"></span>
You can’t perform that action at this time.
0 commit comments