mirror of
https://github.com/go-gitea/gitea.git
synced 2025-06-29 04:29:55 +00:00
Refactor Branch struct in package modules/git (#33980)
The `Branch` struct in `modules/git` package is unnecessary. We can just use a `string` to represent a branch
This commit is contained in:
parent
285950a222
commit
c27d87a9ac
16 changed files with 169 additions and 147 deletions
|
@ -11,14 +11,14 @@ import (
|
|||
|
||||
// GetBranchesByPath returns a branch by its path
|
||||
// if limit = 0 it will not limit
|
||||
func GetBranchesByPath(ctx context.Context, repo Repository, skip, limit int) ([]*git.Branch, int, error) {
|
||||
func GetBranchesByPath(ctx context.Context, repo Repository, skip, limit int) ([]string, int, error) {
|
||||
gitRepo, err := OpenRepository(ctx, repo)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
defer gitRepo.Close()
|
||||
|
||||
return gitRepo.GetBranches(skip, limit)
|
||||
return gitRepo.GetBranchNames(skip, limit)
|
||||
}
|
||||
|
||||
func GetBranchCommitID(ctx context.Context, repo Repository, branch string) (string, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue