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:
authorPavlo Strokov <pstrokov@gitlab.com>2020-11-08 18:24:31 +0300
committerPavlo Strokov <pstrokov@gitlab.com>2020-11-20 13:07:13 +0300
commita874e075ed161671d4eb91a57e0dd4d9b2e4a610 (patch)
treeed5bf9af1edbdf47d954ba27c0c9ef15f2720483 /internal/gitaly/service/operations/merge.go
parent9191f8f0f17d3b7a958424f91527aa8d8b4c3fcb (diff)
Unbound initialization and validation funcs from global Config
In order to remove dependency on the global config.Config var we need to break dependencies between Config and it's initialization and validation functions. Most of them now represented as a methods on the config.Cfg type. It allows us to setup required Cfg struct for the tests to run without need to sync changes done on the shared global Config var. The tests that were heavily dependent on the Config var now depend on the struct initialized inside the test instead. Part of: https://gitlab.com/gitlab-org/gitaly/-/issues/2699 Blocks: https://gitlab.com/gitlab-org/gitaly/-/issues/3166
Diffstat (limited to 'internal/gitaly/service/operations/merge.go')
-rw-r--r--internal/gitaly/service/operations/merge.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/internal/gitaly/service/operations/merge.go b/internal/gitaly/service/operations/merge.go
index e953dd95b..73ce55c95 100644
--- a/internal/gitaly/service/operations/merge.go
+++ b/internal/gitaly/service/operations/merge.go
@@ -11,7 +11,6 @@ import (
"gitlab.com/gitlab-org/gitaly/internal/git"
"gitlab.com/gitlab-org/gitaly/internal/git/updateref"
"gitlab.com/gitlab-org/gitaly/internal/git2go"
- "gitlab.com/gitlab-org/gitaly/internal/gitaly/config"
"gitlab.com/gitlab-org/gitaly/internal/gitaly/hook"
"gitlab.com/gitlab-org/gitaly/internal/gitaly/rubyserver"
"gitlab.com/gitlab-org/gitaly/internal/gitlabshell"
@@ -122,7 +121,7 @@ func (s *server) updateReferenceWithHooks(ctx context.Context, repo *gitalypb.Re
fmt.Sprintf("GL_USERNAME=%s", user.GetGlUsername()),
fmt.Sprintf("GL_REPOSITORY=%s", repo.GetGlRepository()),
fmt.Sprintf("GL_PROJECT_PATH=%s", repo.GetGlProjectPath()),
- fmt.Sprintf("GITALY_SOCKET=" + config.GitalyInternalSocketPath()),
+ fmt.Sprintf("GITALY_SOCKET=" + s.cfg.GitalyInternalSocketPath()),
fmt.Sprintf("GITALY_REPO=%s", repo),
fmt.Sprintf("GITALY_TOKEN=%s", s.cfg.Auth.Token),
}, gitlabshellEnv...)