Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2022-07-29 15:47:58 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-08-02 09:27:02 +0300
commit2255b4ba639b0bad45a66117744d7c80f0773db4 (patch)
treec849a0a3449ed8c9f6d5a2e88544031c06062702
parent1e5e0c9bde504598c1203763c742e0f0743acfa1 (diff)
gittest: Disable use of CreateRepository with SHA256 in general
We have already disabled the use of CreateRepository with seeded repositories in 9ef8ff076 (gittest: Disallow use of seeded repositories with SHA256, 2022-07-21) when SHA256 is in use. This isn't broad enough though given that this function uses the `CreateRepository()` RPC behind the scenes which doesn't yet support SHA256 at all, so it doesn't even work to use this function with unseeded repositories. Let's add another test failure that is specific to the unseeded-repo case to avoid accidental use of this function in SHA256 tests.
-rw-r--r--internal/git/gittest/repo.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/git/gittest/repo.go b/internal/git/gittest/repo.go
index 201f459b1..fb9529b1e 100644
--- a/internal/git/gittest/repo.go
+++ b/internal/git/gittest/repo.go
@@ -155,6 +155,10 @@ func CreateRepository(ctx context.Context, t testing.TB, cfg config.Cfg, configs
})
require.NoError(t, err)
} else {
+ if ObjectHashIsSHA256() {
+ require.FailNow(t, "CreateRepository does not yet support creating SHA256 repositories")
+ }
+
_, err := client.CreateRepository(ctx, &gitalypb.CreateRepositoryRequest{
Repository: repository,
})