diff options
author | Andrey Nering <andrey.nering@gmail.com> | 2017-06-12 11:05:01 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-12 11:05:01 -0300 |
commit | 635273cea68400a718806bb1603c5f62a4e66e04 (patch) | |
tree | 952058975350f61350dcd098d48ee77592500039 /modules | |
parent | b5d2780b22c8261e7b9e838df6f24d983b884825 (diff) | |
parent | c85ff532e9154920fc2bc3f6753a805615b924dc (diff) | |
download | gitea-635273cea68400a718806bb1603c5f62a4e66e04.tar.gz gitea-635273cea68400a718806bb1603c5f62a4e66e04.zip |
Merge pull request #1829 from ethantkoenig/no_branches
Commitless repos should be bare
Diffstat (limited to 'modules')
-rw-r--r-- | modules/context/repo.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go index 919105f7b7..545a9a3ff2 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -390,6 +390,10 @@ func RepoRef() macaron.Handler { if err != nil { ctx.Handle(500, "GetBranches", err) return + } else if len(brs) == 0 { + err = fmt.Errorf("No branches in non-bare repository %s", + ctx.Repo.GitRepo.Path) + ctx.Handle(500, "GetBranches", err) } refName = brs[0] } |