diff --git a/routers/web/repo/view_home.go b/routers/web/repo/view_home.go index cc4ea1dca8385..1bd67e0ba0a33 100644 --- a/routers/web/repo/view_home.go +++ b/routers/web/repo/view_home.go @@ -227,7 +227,7 @@ func prepareRecentlyPushedNewBranches(ctx *context.Context) { continue } // Base is the pushed branch (for fork branch or local pushed branch perspective) - if divergingInfo.BaseIsNewer || divergingInfo.CommitsAhead > 0 { + if divergingInfo.BaseIsNewer || divergingInfo.CommitsBehind > 0 { finalBranches = append(finalBranches, branch) } } diff --git a/services/repository/branch.go b/services/repository/branch.go index e36a3a0fbb145..5cb0528613fc2 100644 --- a/services/repository/branch.go +++ b/services/repository/branch.go @@ -651,8 +651,8 @@ type BranchDivergingInfo struct { } // getBranchDivergingInfo returns the information about the divergence of a patch branch to the base branch. -func GetBranchDivergingInfo(ctx reqctx.RequestContext, baseRepo, headRepo *repo_model.Repository, baseBranch, headbranch string) (*BranchDivergingInfo, error) { - headGitBranch, err := git_model.GetBranch(ctx, headRepo.ID, headbranch) +func GetBranchDivergingInfo(ctx reqctx.RequestContext, baseRepo, headRepo *repo_model.Repository, baseBranch, headBranch string) (*BranchDivergingInfo, error) { + headGitBranch, err := git_model.GetBranch(ctx, headRepo.ID, headBranch) if err != nil { return nil, err }