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:
authorStan Hu <stanhu@gmail.com>2019-10-01 03:05:09 +0300
committerStan Hu <stanhu@gmail.com>2019-10-02 23:36:49 +0300
commit9a48afa0b08cb5b17a31e4bbe18730300a910ff3 (patch)
tree0dfe175e2533eeefbc71758b4fccbc6032fbabbf /internal/rubyserver/rubyserver.go
parentb3294d44835329f7759f15c7a25834e6ca7260ca (diff)
Support configurable Git config search path for Rugged
This commit adds an optional `git_config_search_path` parameter for gitaly-ruby. By default, Rugged searches inside `/etc/gitconfig` instead of `/opt/gitlab/embedded/etc/gitconfig` for system-wide options unless the `Rugged::Settings['search_path_system']` is set. This means that important options such as `core.fsyncObjectFiles` are not propagated to gitaly-ruby, which can result in data loss after servers are rebooted. The command-line `git` doesn't have this issue because it uses the `prefix` compile-time option, but this isn't available in Rugged. With this new parameter, package managers (e.g. Omnibus) can specify where the system `gitconfig` file should be. Closes https://gitlab.com/gitlab-org/gitaly/issues/2051
Diffstat (limited to 'internal/rubyserver/rubyserver.go')
-rw-r--r--internal/rubyserver/rubyserver.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/rubyserver/rubyserver.go b/internal/rubyserver/rubyserver.go
index 82f806c5c..1ed292770 100644
--- a/internal/rubyserver/rubyserver.go
+++ b/internal/rubyserver/rubyserver.go
@@ -119,7 +119,8 @@ func (s *Server) start() error {
"GITALY_RUBY_GITALY_BIN_DIR="+cfg.BinDir,
"GITALY_RUBY_DIR="+cfg.Ruby.Dir,
"GITALY_VERSION="+version.GetVersion(),
- "GITALY_GIT_HOOKS_DIR="+hooks.Path())
+ "GITALY_GIT_HOOKS_DIR="+hooks.Path(),
+ "GITALY_GIT_CONFIG_SEARCH_PATH="+cfg.Ruby.GitConfigSearchPath)
env = append(env, gitlabshell.Env()...)
env = append(env, command.GitEnv...)