@@ -167,6 +167,9 @@ func GetBranch(ctx context.Context, repoID int64, branchName string) (*Branch, e
167167 BranchName : branchName ,
168168 }
169169 }
170+ // FIXME: this design is not right: it doesn't check `branch.IsDeleted`, it doesn't make sense to make callers to check IsDeleted again and again.
171+ // It causes inconsistency with `GetBranches` and `git.GetBranch`, and will lead to strange bugs
172+ // In the future, there should be 2 functions: `GetBranchExisting` and `GetBranchWithDeleted`
170173 return & branch , nil
171174}
172175
@@ -440,6 +443,8 @@ type FindRecentlyPushedNewBranchesOptions struct {
440443}
441444
442445type RecentlyPushedNewBranch struct {
446+ BranchRepo * repo_model.Repository
447+ BranchName string
443448 BranchDisplayName string
444449 BranchLink string
445450 BranchCompareURL string
@@ -540,7 +545,9 @@ func FindRecentlyPushedNewBranches(ctx context.Context, doer *user_model.User, o
540545 branchDisplayName = fmt .Sprintf ("%s:%s" , branch .Repo .FullName (), branchDisplayName )
541546 }
542547 newBranches = append (newBranches , & RecentlyPushedNewBranch {
548+ BranchRepo : branch .Repo ,
543549 BranchDisplayName : branchDisplayName ,
550+ BranchName : branch .Name ,
544551 BranchLink : fmt .Sprintf ("%s/src/branch/%s" , branch .Repo .Link (), util .PathEscapeSegments (branch .Name )),
545552 BranchCompareURL : branch .Repo .ComposeBranchCompareURL (opts .BaseRepo , branch .Name ),
546553 CommitTime : branch .CommitTime ,
0 commit comments