summaryrefslogtreecommitdiffstats
path: root/modules/middleware/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/middleware/repo.go')
-rw-r--r--modules/middleware/repo.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go
index 1418486430..afa95a250c 100644
--- a/modules/middleware/repo.go
+++ b/modules/middleware/repo.go
@@ -79,6 +79,12 @@ func ApiRepoAssignment() macaron.Handler {
// RepoRef handles repository reference name including those contain `/`.
func RepoRef() macaron.Handler {
return func(ctx *Context) {
+ // Empty repository does not have reference information.
+ if ctx.Repo.Repository.IsBare {
+ ctx.Data["CommitsCount"] = 0
+ return
+ }
+
var (
refName string
err error