diff options
author | zeripath <art27@cantab.net> | 2020-01-07 17:06:14 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-07 17:06:14 +0000 |
commit | e5d8e2d10c6798e57ac855f71b025b087b664799 (patch) | |
tree | e00324f545d553aa1ef7ccf693b95577c5dd67a1 /templates/repo | |
parent | 940636863370855f39688ddf0aae41667ac8935c (diff) | |
download | gitea-e5d8e2d10c6798e57ac855f71b025b087b664799.tar.gz gitea-e5d8e2d10c6798e57ac855f71b025b087b664799.zip |
Branches not at ref commit ID should not be listed as Merged (#9614)
Once a branch has been merged if the commit ID no longer equals that of
the pulls ref commit id don't offer to delete the branch on the pull screen
and don't list it as merged on branches.
Fix #9201
When looking at the pull page we should also get the commits from the refs/pulls/x/head
Fix #9158
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/branch/list.tmpl | 6 | ||||
-rw-r--r-- | templates/repo/issue/view_content/pull.tmpl | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index 8fb365d805..073516f25f 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -84,6 +84,12 @@ <button id="new-pull-request" class="ui compact basic button">{{$.i18n.Tr "repo.pulls.compare_changes"}}</button> </a> {{end}} + {{else if and .LatestPullRequest.HasMerged .MergeMovedOn}} + {{if and (not .IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}} + <a href="{{$.RepoLink}}/compare/{{$.DefaultBranch | EscapePound}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{$.Owner.Name}}:{{end}}{{.Name | EscapePound}}"> + <button id="new-pull-request" class="ui compact basic button">{{$.i18n.Tr "repo.pulls.compare_changes"}}</button> + </a> + {{end}} {{else}} <a href="{{$.RepoLink}}/pulls/{{.LatestPullRequest.Issue.Index}}">#{{.LatestPullRequest.Issue.Index}}</a> {{if .LatestPullRequest.HasMerged}} diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index cec10a620e..2dc76dcf2e 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -72,7 +72,7 @@ {{$.i18n.Tr "repo.pulls.reopen_to_merge"}} {{end}} </div> - {{if .IsPullBranchDeletable}} + {{if and .IsPullBranchDeletable ( not .IsPullRequestBroken )}} <div class="ui divider"></div> <div> <a class="delete-button ui red button" href="" data-url="{{.DeleteBranchLink}}">{{$.i18n.Tr "repo.branch.delete" .HeadTarget}}</a> @@ -105,7 +105,7 @@ <div class="item text red"> <span class="octicon octicon-x"></span> {{$.i18n.Tr "repo.pulls.blocked_by_rejection"}} - </div> + </div> {{else if .Issue.PullRequest.IsChecking}} <div class="item text yellow"> <span class="octicon octicon-sync"></span> |