Skip to content

Commit

Permalink
Fix branch list bug which displayed default branch twice (go-gitea#28878
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny authored and Henry Goodman committed Jan 31, 2024
1 parent 07b230a commit 77c1eac
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions services/repository/branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,15 @@ func LoadBranches(ctx context.Context, repo *repo_model.Repository, gitRepo *git
Page: page,
PageSize: pageSize,
},
Keyword: keyword,
Keyword: keyword,
ExcludeBranchNames: []string{repo.DefaultBranch},
}

dbBranches, totalNumOfBranches, err := db.FindAndCount[git_model.Branch](ctx, branchOpts)
if err != nil {
return nil, nil, 0, err
}

branchOpts.ExcludeBranchNames = []string{repo.DefaultBranch}

if err := git_model.BranchList(dbBranches).LoadDeletedBy(ctx); err != nil {
return nil, nil, 0, err
}
Expand Down

0 comments on commit 77c1eac

Please sign in to comment.