aboutsummaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorCuong Manh Le <cuong.manhle.vn@gmail.com>2020-05-31 11:51:19 +0700
committerGitHub <noreply@github.com>2020-05-31 00:51:19 -0400
commitd98df0ede368bfaad173b2c1e0d8f207c758eef0 (patch)
tree1db553501abf2dcf598a3f97d85592dadfa1a2cb /models/repo.go
parentcdec70f3f8d35b4a27db8b39cbb63d7f1553312c (diff)
downloadgitea-d98df0ede368bfaad173b2c1e0d8f207c758eef0.tar.gz
gitea-d98df0ede368bfaad173b2c1e0d8f207c758eef0.zip
models: include LFS when calculating repo size (#11060)
Fixes #9369 Co-authored-by: John Olheiser <john.olheiser@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go
index d31d262c8d..dceeeb89e9 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -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