summaryrefslogtreecommitdiffstats
path: root/modules/repository/create_test.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2023-01-16 22:07:06 +0000
committerGitHub <noreply@github.com>2023-01-16 16:07:06 -0600
commit9a6d78eaa89ffbf60a1f579bd220fe0cfb720e3b (patch)
tree44bca326c92c8a42f943e1d6219ac95a9e9d15da /modules/repository/create_test.go
parentaf8151cbb9e62cf60b2d9276fab2564c5cede45b (diff)
downloadgitea-9a6d78eaa89ffbf60a1f579bd220fe0cfb720e3b.tar.gz
gitea-9a6d78eaa89ffbf60a1f579bd220fe0cfb720e3b.zip
Fix error when calculate the repository size (#22392) (#22474)
Backport #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 'modules/repository/create_test.go')
-rw-r--r--modules/repository/create_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/repository/create_test.go b/modules/repository/create_test.go
index 3040782845..ff70468db1 100644
--- a/modules/repository/create_test.go
+++ b/modules/repository/create_test.go
@@ -169,3 +169,13 @@ func TestUpdateRepositoryVisibilityChanged(t *testing.T) {
assert.NoError(t, err)
assert.True(t, act.IsPrivate)
}
+
+func TestGetDirectorySize(t *testing.T) {
+ assert.NoError(t, unittest.PrepareTestDatabase())
+ repo, err := repo_model.GetRepositoryByID(1)
+ assert.NoError(t, err)
+
+ size, err := getDirectorySize(repo.RepoPath())
+ assert.NoError(t, err)
+ assert.EqualValues(t, size, repo.Size)
+}