Gracefully handle bare repositories on API operations. (#1932)

Signed-off-by: Dennis Keitzel <github@pinshot.net>
This commit is contained in:
Dennis Keitzel authored and Bo-Yi Wu committed 2017-06-10 21:57:28 -05:00
1 parent f2fcd9dcd8
commit 96b4780727
3 files changed
+12 -2

No files matched your search

+1 -1
View File
@@ -39,7 +39,7 @@ func GetBranchesByPath(path string) ([]*Branch, error) {
// GetBranch returns a branch by it's name
func (repo *Repository) GetBranch(branch string) (*Branch, error) {
if !git.IsBranchExist(repo.RepoPath(), branch) {
return nil, &ErrBranchNotExist{branch}
return nil, ErrBranchNotExist{branch}
}
return &Branch{
Path: repo.RepoPath(),