diff options
author | John Cai <jcai@gitlab.com> | 2022-11-13 05:10:03 +0300 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2023-02-24 18:50:07 +0300 |
commit | fa3945d29893488fae43c16da56f30f10e77be98 (patch) | |
tree | f75df6d9346570d9a9b960ff4fb250e199d6d411 /internal/gitaly/service/operations/submodules_test.go | |
parent | c11b86447b9c3618e8b24abfa957f8c46705fe49 (diff) |
operations: Reimplement UserUpdateSubmodule using git plumbing commands
Updating a submodule is simply updating the oid of the commit at the
path. We can do this by manually rewriting trees and writing a new
commit. If we impelement it this way, we don't need to rely on Git2Go.
Diffstat (limited to 'internal/gitaly/service/operations/submodules_test.go')
-rw-r--r-- | internal/gitaly/service/operations/submodules_test.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/gitaly/service/operations/submodules_test.go b/internal/gitaly/service/operations/submodules_test.go index 02f35d8c9..ffe2db4b3 100644 --- a/internal/gitaly/service/operations/submodules_test.go +++ b/internal/gitaly/service/operations/submodules_test.go @@ -4,6 +4,7 @@ package operations import ( "bytes" + "context" "fmt" "path/filepath" "testing" @@ -14,6 +15,7 @@ import ( "gitlab.com/gitlab-org/gitaly/v15/internal/git/localrepo" "gitlab.com/gitlab-org/gitaly/v15/internal/git/lstree" "gitlab.com/gitlab-org/gitaly/v15/internal/helper/text" + "gitlab.com/gitlab-org/gitaly/v15/internal/metadata/featureflag" "gitlab.com/gitlab-org/gitaly/v15/internal/structerr" "gitlab.com/gitlab-org/gitaly/v15/internal/testhelper" "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" @@ -22,7 +24,11 @@ import ( func TestUserUpdateSubmodule(t *testing.T) { t.Parallel() - ctx := testhelper.Context(t) + testhelper.NewFeatureSets(featureflag.SubmoduleInGit). + Run(t, testUserUpdateSubmodule) +} + +func testUserUpdateSubmodule(t *testing.T, ctx context.Context) { ctx, cfg, client := setupOperationsServiceWithoutRepo(t, ctx) type setupData struct { |