summaryrefslogtreecommitdiffstats
path: root/routers/repo/single.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/single.go')
-rw-r--r--routers/repo/single.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/routers/repo/single.go b/routers/repo/single.go
index e218bc9158..f1b15cceed 100644
--- a/routers/repo/single.go
+++ b/routers/repo/single.go
@@ -87,6 +87,11 @@ func Single(ctx *middleware.Context, params martini.Params) {
branchLink := "/" + ctx.Repo.Owner.LowerName + "/" + ctx.Repo.Repository.Name + "/src/" + params["branchname"]
+ if len(treename) != 0 && repoFile == nil {
+ ctx.Error(404)
+ return
+ }
+
if repoFile != nil && repoFile.IsFile() {
if repoFile.Size > 1024*1024 || repoFile.Filemode != git.FileModeBlob {
ctx.Data["FileIsLarge"] = true