|
|
@@ -76,25 +76,6 @@ func (repo *Repository) SetDefaultBranch(name string) error { |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
// GetBranches returns all branches of the repository. |
|
|
|
//func (repo *Repository) GetBranches() ([]string, error) { |
|
|
|
// var branchNames []string |
|
|
|
// |
|
|
|
// branches, err := repo.gogitRepo.Branches() |
|
|
|
// if err != nil { |
|
|
|
// return nil, err |
|
|
|
// } |
|
|
|
// |
|
|
|
// _ = branches.ForEach(func(branch *plumbing.Reference) error { |
|
|
|
// branchNames = append(branchNames, strings.TrimPrefix(branch.Name().String(), BranchPrefix)) |
|
|
|
// return nil |
|
|
|
// }) |
|
|
|
// |
|
|
|
// // TODO: Sort? |
|
|
|
// |
|
|
|
// return branchNames, nil |
|
|
|
//} |
|
|
|
|
|
|
|
// GetBranch returns a branch by it's name |
|
|
|
func (repo *Repository) GetBranch(branch string) (*Branch, error) { |
|
|
|
if !repo.IsBranchExist(branch) { |
|
|
|