Skip to content

Commit

Permalink
models: include LFS when calculating repo size (#11060)
Browse files Browse the repository at this point in the history
Fixes #9369

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
  • Loading branch information
3 people authored May 31, 2020
1 parent cdec70f commit d98df0e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions models/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,14 @@ func (repo *Repository) updateSize(e Engine) error {
return fmt.Errorf("updateSize: %v", err)
}

objs, err := repo.GetLFSMetaObjects(-1, 0)
if err != nil {
return fmt.Errorf("updateSize: GetLFSMetaObjects: %v", err)
}
for _, obj := range objs {
size += obj.Size
}

repo.Size = size
_, err = e.ID(repo.ID).Cols("size").Update(repo)
return err
Expand Down

0 comments on commit d98df0e

Please sign in to comment.