1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-10 03:28:20 +00:00

Fix lfs bug (#19072) (#19080)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
6543
2022-03-14 15:59:54 +01:00
committed by GitHub
parent 66b8a43e5f
commit 99861e3e06
3 changed files with 82 additions and 3 deletions

View File

@@ -253,6 +253,13 @@ func LFSFileGet(ctx *context.Context) {
}
ctx.Data["LFSFilesLink"] = ctx.Repo.RepoLink + "/settings/lfs"
oid := ctx.Params("oid")
p := lfs.Pointer{Oid: oid}
if !p.IsValid() {
ctx.NotFound("LFSFileGet", nil)
return
}
ctx.Data["Title"] = oid
ctx.Data["PageIsSettingsLFS"] = true
meta, err := models.GetLFSMetaObjectByOid(ctx.Repo.Repository.ID, oid)
@@ -343,6 +350,12 @@ func LFSDelete(ctx *context.Context) {
return
}
oid := ctx.Params("oid")
p := lfs.Pointer{Oid: oid}
if !p.IsValid() {
ctx.NotFound("LFSDelete", nil)
return
}
count, err := models.RemoveLFSMetaObjectByOid(ctx.Repo.Repository.ID, oid)
if err != nil {
ctx.ServerError("LFSDelete", err)