mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-20 14:00:04 +02:00
Corrections following recommendations
This commit is contained in:
parent
81e5722bcc
commit
b7b30cd85e
5 changed files with 39 additions and 37 deletions
|
@ -288,9 +288,9 @@ func (repo *Repository) GetMirror() (err error) {
|
|||
return err
|
||||
}
|
||||
|
||||
func (repo *Repository) GetBranch(br string) (_ *Branch, err error) {
|
||||
func (repo *Repository) GetBranch(br string) (*Branch, error) {
|
||||
if(!git.IsBranchExist(repo.RepoPath(), br)){
|
||||
return nil, errors.New("Branch do not exist");
|
||||
return nil, fmt.Errorf("Branch does not exist: %s", br);
|
||||
}
|
||||
return &Branch{
|
||||
Path: repo.RepoPath(),
|
||||
|
@ -298,7 +298,7 @@ func (repo *Repository) GetBranch(br string) (_ *Branch, err error) {
|
|||
},nil
|
||||
}
|
||||
|
||||
func (repo *Repository) GetBranches() (_ []*Branch, err error) {
|
||||
func (repo *Repository) GetBranches() ([]*Branch, error) {
|
||||
return GetBranchesByPath(repo.RepoPath())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue