summaryrefslogtreecommitdiffstats
path: root/models/repo_branch.go
diff options
context:
space:
mode:
authorDennis Keitzel <github@pinshot.net>2017-06-11 04:57:28 +0200
committerBo-Yi Wu <appleboy.tw@gmail.com>2017-06-10 21:57:28 -0500
commit96b4780727b49a2c30c640a73751566f60ffc2af (patch)
tree874c3bd796279cb5e1bf9cc560a07edc3a946673 /models/repo_branch.go
parentf2fcd9dcd834b611d2f321829e814a741054c4ea (diff)
downloadgitea-96b4780727b49a2c30c640a73751566f60ffc2af.tar.gz
gitea-96b4780727b49a2c30c640a73751566f60ffc2af.zip
Gracefully handle bare repositories on API operations. (#1932)
Signed-off-by: Dennis Keitzel <github@pinshot.net>
Diffstat (limited to 'models/repo_branch.go')
-rw-r--r--models/repo_branch.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/repo_branch.go b/models/repo_branch.go
index fcfd3e8ecb..4821902e37 100644
--- a/models/repo_branch.go
+++ b/models/repo_branch.go
@@ -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(),