diff options
author | Will Chandler <wchandler@gitlab.com> | 2024-01-18 00:57:51 +0300 |
---|---|---|
committer | GitLab <noreply@gitlab.com> | 2024-01-18 00:57:51 +0300 |
commit | 72faf14d9551b706f46103d665d75099ea8b1b0c (patch) | |
tree | 85abb862a6a39219643585785869aa626964cffb /internal/gitaly/service/repository/size_test.go | |
parent | 2f1b99e352ec5c4e270e7ecb9e4234244bf37dee (diff) | |
parent | 36339ff6300a2cc727441aa897e2793bd2fcd98a (diff) |
Merge branch 'xx/fix-typos' into 'master'
fix: Fix a collection of typos found by typos-cli
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6594
Merged-by: Will Chandler <wchandler@gitlab.com>
Approved-by: Evan Read <eread@gitlab.com>
Co-authored-by: Xing Xin <xingxin.xx@bytedance.com>
Diffstat (limited to 'internal/gitaly/service/repository/size_test.go')
-rw-r--r-- | internal/gitaly/service/repository/size_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/internal/gitaly/service/repository/size_test.go b/internal/gitaly/service/repository/size_test.go index d955d33ad..1684793b0 100644 --- a/internal/gitaly/service/repository/size_test.go +++ b/internal/gitaly/service/repository/size_test.go @@ -38,7 +38,7 @@ Object pools are not yet supported with transaction management.`) // a packfile or otherwise it won't get pulled into the object pool. We thus repack the repository first before // linking it to the pool repository. gittest.WriteCommit(t, cfg, repoPath, gittest.WithBranch(git.DefaultBranch), gittest.WithTreeEntries( - gittest.TreeEntry{Mode: "100644", Path: "16kbblob", Content: string(uncompressibleData(16 * 1000))}, + gittest.TreeEntry{Mode: "100644", Path: "16kbblob", Content: string(incompressibleData(16 * 1000))}, )) gittest.Exec(t, cfg, "-C", repoPath, "repack", "-Adl") requireRepositorySize(t, ctx, client, repo, 17) @@ -66,15 +66,15 @@ func TestRepositorySize_normalRepository(t *testing.T) { requireRepositorySize(t, ctx, client, repo, 0) // When writing a largish blob into the repository it's expected to grow. - gittest.WriteBlob(t, cfg, repoPath, uncompressibleData(16*1024)) + gittest.WriteBlob(t, cfg, repoPath, incompressibleData(16*1024)) requireRepositorySize(t, ctx, client, repo, 16) // Also, updating any other files should cause a size increase. - require.NoError(t, os.WriteFile(filepath.Join(repoPath, "packed-refs"), uncompressibleData(7*1024), perm.PrivateFile)) + require.NoError(t, os.WriteFile(filepath.Join(repoPath, "packed-refs"), incompressibleData(7*1024), perm.PrivateFile)) requireRepositorySize(t, ctx, client, repo, 23) // Even garbage should increase the size. - require.NoError(t, os.WriteFile(filepath.Join(repoPath, "garbage"), uncompressibleData(5*1024), perm.PrivateFile)) + require.NoError(t, os.WriteFile(filepath.Join(repoPath, "garbage"), incompressibleData(5*1024), perm.PrivateFile)) requireRepositorySize(t, ctx, client, repo, 28) } @@ -169,7 +169,7 @@ func TestGetObjectDirectorySize_successful(t *testing.T) { requireObjectDirectorySize(t, ctx, client, repo, 0) // Writing an object into the repository should increase the size accordingly. - gittest.WriteBlob(t, cfg, repoPath, uncompressibleData(16*1024)) + gittest.WriteBlob(t, cfg, repoPath, incompressibleData(16*1024)) requireObjectDirectorySize(t, ctx, client, repo, 16) } @@ -184,7 +184,7 @@ func TestGetObjectDirectorySize_quarantine(t *testing.T) { t.Run("quarantined repo", func(t *testing.T) { repo, repoPath := gittest.CreateRepository(t, ctx, cfg) repo.GitObjectDirectory = "objects/" - gittest.WriteBlob(t, cfg, repoPath, uncompressibleData(16*1024)) + gittest.WriteBlob(t, cfg, repoPath, incompressibleData(16*1024)) // Rails sends the repository's relative path from the access checks as provided by Gitaly. If transactions are enabled, // this is the snapshot's relative path. Include the metadata in the test as well as we're testing requests with quarantine @@ -274,10 +274,10 @@ func requireObjectDirectorySize(tb testing.TB, ctx context.Context, client gital require.Equal(tb, expectedSize, response.GetSize()) } -// uncompressibleData returns data that will not be easily compressible by Git. This is required because +// incompressibleData returns data that will not be easily compressible by Git. This is required because // well-compressible objects would not lead to a repository size increase due to the zlib compression used for Git // objects. -func uncompressibleData(bytes int) []byte { +func incompressibleData(bytes int) []byte { data := make([]byte, bytes) _, _ = rand.Read(data[:]) return data |