mirror of
https://github.com/gogs/gogs.git
synced 2026-02-01 03:59:19 +01:00
Verify repository is not bare before retrieving blob. (#3996)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user