File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1448,6 +1448,7 @@ branch.restore_failed = Failed to restore branch '%s'.
14481448branch.protected_deletion_failed = Branch ' %s' is protected. It cannot be deleted.
14491449branch.restore = Restore Branch ' %s'
14501450branch.download = Download Branch ' %s'
1451+ branch.manual_merged = Branch was merged manually
14511452
14521453topic.manage_topics = Manage Topics
14531454topic.done = Done
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ type Branch struct {
2828 Commit * git.Commit
2929 IsProtected bool
3030 IsDeleted bool
31+ IsMerged bool
3132 DeletedBranch * models.DeletedBranch
3233 CommitsAhead int
3334 CommitsBehind int
@@ -203,10 +204,16 @@ func loadBranches(ctx *context.Context) []*Branch {
203204 }
204205 }
205206
207+ isMerged := true
208+ if (divergence .Ahead != 0 ) || (divergence .Behind == 0 ) || (ctx .Repo .Repository .DefaultBranch == branchName ) {
209+ isMerged = false
210+ }
211+
206212 branches [i ] = & Branch {
207213 Name : branchName ,
208214 Commit : commit ,
209215 IsProtected : isProtected ,
216+ IsMerged : isMerged ,
210217 CommitsAhead : divergence .Ahead ,
211218 CommitsBehind : divergence .Behind ,
212219 LatestPullRequest : pr ,
Original file line number Diff line number Diff line change 7575 </td>
7676 <td class="two wide right aligned">
7777 {{if not .LatestPullRequest}}
78- {{if and (not .IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}}
78+ {{if .IsMerged}}
79+ <div class="ui poping up purple small label" data-content="{{$.i18n.Tr "repo.branch.manual_merged"}}" data-variation="tiny inverted" data-position="top right">
80+ <i class="octicon octicon-git-pull-request"></i> {{$.i18n.Tr "repo.pulls.merged"}}
81+ </div>
82+ {{else if and (not .IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}}
7983 <a href="{{$.RepoLink}}/compare/{{$.DefaultBranch | EscapePound}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{$.Owner.Name}}:{{end}}{{.Name | EscapePound}}">
8084 <button id="new-pull-request" class="ui compact basic button">{{$.i18n.Tr "repo.pulls.compare_changes"}}</button>
8185 </a>
You can’t perform that action at this time.
0 commit comments