aboutsummaryrefslogtreecommitdiff
path: root/routers/repo/issue.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/issue.go')
-rw-r--r--routers/repo/issue.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index 21d4c7d9..cb508052 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -629,6 +629,15 @@ func ViewIssue(ctx *context.Context) {
}
}
+ if issue.IsPull && issue.PullRequest.HasMerged {
+ pull := issue.PullRequest
+ ctx.Data["IsPullBranchDeletable"] = pull.BaseRepoID == pull.HeadRepoID &&
+ ctx.Repo.IsWriter() && ctx.Repo.GitRepo.IsBranchExist(pull.HeadBranch)
+
+ deleteBranchUrl := ctx.Repo.RepoLink + "/branches/" + pull.HeadBranch + "/delete"
+ ctx.Data["DeleteBranchLink"] = fmt.Sprintf("%s?commit=%s&redirect_to=%s", deleteBranchUrl, pull.MergedCommitID, ctx.Data["Link"])
+ }
+
ctx.Data["Participants"] = participants
ctx.Data["NumParticipants"] = len(participants)
ctx.Data["Issue"] = issue