summaryrefslogtreecommitdiffstats
path: root/modules/context
diff options
context:
space:
mode:
authorEthan Koenig <ethantkoenig@gmail.com>2017-05-28 22:25:23 -0400
committerEthan Koenig <ethantkoenig@gmail.com>2017-05-28 22:31:40 -0400
commitc85ff532e9154920fc2bc3f6753a805615b924dc (patch)
tree66e724ba00bec5f714db404660ec8f791879bda2 /modules/context
parente67ece26f0b97437200998b9b153b4c3a87a65aa (diff)
downloadgitea-c85ff532e9154920fc2bc3f6753a805615b924dc.tar.gz
gitea-c85ff532e9154920fc2bc3f6753a805615b924dc.zip
Commitless repos should be bare
Diffstat (limited to 'modules/context')
-rw-r--r--modules/context/repo.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go
index a59dc7da28..3b159a7aaa 100644
--- a/modules/context/repo.go
+++ b/modules/context/repo.go
@@ -392,6 +392,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]
}