aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--routers/api/v1/repo/file.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/routers/api/v1/repo/file.go b/routers/api/v1/repo/file.go
index ee9d15a3..5da91d9e 100644
--- a/routers/api/v1/repo/file.go
+++ b/routers/api/v1/repo/file.go
@@ -19,6 +19,11 @@ func GetRawFile(ctx *context.APIContext) {
return
}
+ if ctx.Repo.Repository.IsBare {
+ ctx.Status(404)
+ return
+ }
+
blob, err := ctx.Repo.Commit.GetBlobByPath(ctx.Repo.TreePath)
if err != nil {
if git.IsErrNotExist(err) {