File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -1453,6 +1453,8 @@ branch.restore_failed = Failed to restore branch '%s'.
14531453branch.protected_deletion_failed = Branch ' %s' is protected. It cannot be deleted.
14541454branch.restore = Restore Branch ' %s'
14551455branch.download = Download Branch ' %s'
1456+ branch.included_desc = This branch is part of the default branch
1457+ branch.included = Included
14561458
14571459topic.manage_topics = Manage Topics
14581460topic.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+ IsIncluded bool
3132 DeletedBranch * models.DeletedBranch
3233 CommitsAhead int
3334 CommitsBehind int
@@ -203,10 +204,13 @@ func loadBranches(ctx *context.Context) []*Branch {
203204 }
204205 }
205206
207+ isIncluded := divergence .Ahead == 0 && ctx .Repo .Repository .DefaultBranch != branchName
208+
206209 branches [i ] = & Branch {
207210 Name : branchName ,
208211 Commit : commit ,
209212 IsProtected : isProtected ,
213+ IsIncluded : isIncluded ,
210214 CommitsAhead : divergence .Ahead ,
211215 CommitsBehind : divergence .Behind ,
212216 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 .IsIncluded}}
79+ <a class="ui poping up orange small label" data-content="{{$.i18n.Tr "repo.branch.included_desc"}}" data-variation="tiny inverted" data-position="top right">
80+ <i class="octicon octicon-git-pull-request"></i> {{$.i18n.Tr "repo.branch.included"}}
81+ </a>
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