File tree 3 files changed +13
-1
lines changed
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'.
1448
1448
branch.protected_deletion_failed = Branch ' %s' is protected. It cannot be deleted.
1449
1449
branch.restore = Restore Branch ' %s'
1450
1450
branch.download = Download Branch ' %s'
1451
+ branch.manual_merged = Branch was merged manually
1451
1452
1452
1453
topic.manage_topics = Manage Topics
1453
1454
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
+ IsMerged bool
31
32
DeletedBranch * models.DeletedBranch
32
33
CommitsAhead int
33
34
CommitsBehind int
@@ -203,10 +204,16 @@ func loadBranches(ctx *context.Context) []*Branch {
203
204
}
204
205
}
205
206
207
+ isMerged := true
208
+ if (divergence .Ahead != 0 ) || (divergence .Behind == 0 ) || (ctx .Repo .Repository .DefaultBranch == branchName ) {
209
+ isMerged = false
210
+ }
211
+
206
212
branches [i ] = & Branch {
207
213
Name : branchName ,
208
214
Commit : commit ,
209
215
IsProtected : isProtected ,
216
+ IsMerged : isMerged ,
210
217
CommitsAhead : divergence .Ahead ,
211
218
CommitsBehind : divergence .Behind ,
212
219
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 .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)}}
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