summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-01-14 02:54:02 +0800
committerGitHub <noreply@github.com>2023-01-13 18:54:02 +0000
commita3ab82e5924196632f1731ae3ef2099bf9d39501 (patch)
tree7b4f840dae95f4f5b2a3ff11d822e3fdf45016e6 /models
parent4fc1517da0014ea4414ac51d67b26553c30139a1 (diff)
downloadgitea-a3ab82e5924196632f1731ae3ef2099bf9d39501.tar.gz
gitea-a3ab82e5924196632f1731ae3ef2099bf9d39501.zip
Fix error when calculate the repository size (#22392)
Fix #22386 `GetDirectorySize` moved as `getDirectorySize` because it becomes a special function which should not be put in `util`. Co-authored-by: Jason Song <i@wolfogre.com>
Diffstat (limited to 'models')
-rw-r--r--models/fixtures/repository.yml2
-rw-r--r--models/repo/update.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/models/fixtures/repository.yml b/models/fixtures/repository.yml
index 19b243fb4e..5d4781ad44 100644
--- a/models/fixtures/repository.yml
+++ b/models/fixtures/repository.yml
@@ -24,7 +24,7 @@
fork_id: 0
is_template: false
template_id: 0
- size: 0
+ size: 6708
is_fsck_enabled: true
close_issues_via_commit_in_any_branch: false
diff --git a/models/repo/update.go b/models/repo/update.go
index 3aef280ff8..8dd1097450 100644
--- a/models/repo/update.go
+++ b/models/repo/update.go
@@ -184,7 +184,7 @@ func ChangeRepositoryName(doer *user_model.User, repo *Repository, newRepoName s
return committer.Commit()
}
-// UpdateRepoSize updates the repository size, calculating it using util.GetDirectorySize
+// UpdateRepoSize updates the repository size, calculating it using getDirectorySize
func UpdateRepoSize(ctx context.Context, repoID, size int64) error {
_, err := db.GetEngine(ctx).ID(repoID).Cols("size").NoAutoTime().Update(&Repository{
Size: size,