File tree 3 files changed +11
-1
lines changed
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'.
1453
1453
branch.protected_deletion_failed = Branch ' %s' is protected. It cannot be deleted.
1454
1454
branch.restore = Restore Branch ' %s'
1455
1455
branch.download = Download Branch ' %s'
1456
+ branch.included_desc = This branch is part of the default branch
1457
+ branch.included = Included
1456
1458
1457
1459
topic.manage_topics = Manage Topics
1458
1460
topic.done = Done
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ type Branch struct {
28
28
Commit * git.Commit
29
29
IsProtected bool
30
30
IsDeleted bool
31
+ IsIncluded bool
31
32
DeletedBranch * models.DeletedBranch
32
33
CommitsAhead int
33
34
CommitsBehind int
@@ -203,10 +204,13 @@ func loadBranches(ctx *context.Context) []*Branch {
203
204
}
204
205
}
205
206
207
+ isIncluded := divergence .Ahead == 0 && ctx .Repo .Repository .DefaultBranch != branchName
208
+
206
209
branches [i ] = & Branch {
207
210
Name : branchName ,
208
211
Commit : commit ,
209
212
IsProtected : isProtected ,
213
+ IsIncluded : isIncluded ,
210
214
CommitsAhead : divergence .Ahead ,
211
215
CommitsBehind : divergence .Behind ,
212
216
LatestPullRequest : pr ,
Original file line number Diff line number Diff line change 75
75
</td>
76
76
<td class="two wide right aligned">
77
77
{{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)}}
79
83
<a href="{{$.RepoLink}}/compare/{{$.DefaultBranch | EscapePound}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{$.Owner.Name}}:{{end}}{{.Name | EscapePound}}">
80
84
<button id="new-pull-request" class="ui compact basic button">{{$.i18n.Tr "repo.pulls.compare_changes"}}</button>
81
85
</a>
You can’t perform that action at this time.
0 commit comments