Skip to content

Commit 35b7c99

Browse files
committed
add property IsIncluded
1 parent 6dacd1b commit 35b7c99

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

routers/repo/branch.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)