summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-11-15 14:05:51 -0500
committerUnknwon <u@gogs.io>2015-11-15 14:05:51 -0500
commitb4970b3cc31d09b2b74d1ace4bfb39ab494d8d24 (patch)
tree478246214f54aebe7a988935b77b6f86c06a9c9e /modules
parent84a43b38cfe88f7199a5e883f00a0ef5091a69d0 (diff)
downloadgitea-b4970b3cc31d09b2b74d1ace4bfb39ab494d8d24.tar.gz
gitea-b4970b3cc31d09b2b74d1ace4bfb39ab494d8d24.zip
fix #1948
Diffstat (limited to 'modules')
-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