Corrections following recommendations

This commit is contained in:
Antoine GIRARD 2016-01-28 20:49:05 +01:00
parent 81e5722bcc
commit b7b30cd85e
5 changed files with 39 additions and 37 deletions

View file

@ -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())
}