diff options
author | Stan Hu <stanhu@gmail.com> | 2019-10-01 09:35:03 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-10-02 23:36:49 +0300 |
commit | 5994ced8fa61cde9a993929fdfb7b4f131f9ace6 (patch) | |
tree | fef396b957099281ddf29105d35b241c77d28dcc | |
parent | 9a48afa0b08cb5b17a31e4bbe18730300a910ff3 (diff) |
Rename git_config_search_path -> rugged_git_config_search_path
-rw-r--r-- | config.toml.example | 2 | ||||
-rw-r--r-- | internal/config/ruby.go | 6 | ||||
-rw-r--r-- | internal/rubyserver/rubyserver.go | 2 | ||||
-rw-r--r-- | ruby/lib/gitlab/config.rb | 4 | ||||
-rw-r--r-- | ruby/lib/gitlab/git/repository.rb | 4 | ||||
-rw-r--r-- | ruby/spec/lib/gitlab/git/repository_spec.rb | 4 |
6 files changed, 11 insertions, 11 deletions
diff --git a/config.toml.example b/config.toml.example index faf8ea92a..fccfc31d9 100644 --- a/config.toml.example +++ b/config.toml.example @@ -76,7 +76,7 @@ dir = "/home/git/gitaly/ruby" # # # Search path for system gitconfig file (e.g. /etc, /opt/gitlab/embedded/etc) # # NOTE: This only affects RPCs that use Rugged. -# git_config_search_path = "/etc" +# rugged_git_config_search_path = "/etc" [gitlab-shell] # The directory where gitlab-shell is installed diff --git a/internal/config/ruby.go b/internal/config/ruby.go index a85e45dc2..6cf4e2e52 100644 --- a/internal/config/ruby.go +++ b/internal/config/ruby.go @@ -16,7 +16,7 @@ type Ruby struct { RestartDelayToml duration `toml:"restart_delay"` NumWorkers int `toml:"num_workers"` LinguistLanguagesPath string `toml:"linguist_languages_path"` - GitConfigSearchPath string `toml:"git_config_search_path"` + RuggedGitConfigSearchPath string `toml:"rugged_git_config_search_path"` } // This type is a trick to let our TOML library parse durations from strings. @@ -61,8 +61,8 @@ func ConfigureRuby() error { return err } - if len(Config.Ruby.GitConfigSearchPath) != 0 { - Config.Ruby.GitConfigSearchPath, err = filepath.Abs(Config.Ruby.GitConfigSearchPath) + if len(Config.Ruby.RuggedGitConfigSearchPath) != 0 { + Config.Ruby.RuggedGitConfigSearchPath, err = filepath.Abs(Config.Ruby.RuggedGitConfigSearchPath) if err != nil { return err } diff --git a/internal/rubyserver/rubyserver.go b/internal/rubyserver/rubyserver.go index 1ed292770..b9cc7d19d 100644 --- a/internal/rubyserver/rubyserver.go +++ b/internal/rubyserver/rubyserver.go @@ -120,7 +120,7 @@ func (s *Server) start() error { "GITALY_RUBY_DIR="+cfg.Ruby.Dir, "GITALY_VERSION="+version.GetVersion(), "GITALY_GIT_HOOKS_DIR="+hooks.Path(), - "GITALY_GIT_CONFIG_SEARCH_PATH="+cfg.Ruby.GitConfigSearchPath) + "GITALY_RUGGED_GIT_CONFIG_SEARCH_PATH="+cfg.Ruby.RuggedGitConfigSearchPath) env = append(env, gitlabshell.Env()...) env = append(env, command.GitEnv...) diff --git a/ruby/lib/gitlab/config.rb b/ruby/lib/gitlab/config.rb index 1af818b23..d644d88aa 100644 --- a/ruby/lib/gitlab/config.rb +++ b/ruby/lib/gitlab/config.rb @@ -36,8 +36,8 @@ module Gitlab @max_commit_or_tag_message_size ||= ENV['GITALY_RUBY_MAX_COMMIT_OR_TAG_MESSAGE_SIZE'].to_i end - def config_search_path - @config_search_path ||= ENV['GITALY_GIT_CONFIG_SEARCH_PATH'] + def rugged_git_config_search_path + @rugged_git_config_search_path ||= ENV['GITALY_RUGGED_GIT_CONFIG_SEARCH_PATH'] end end diff --git a/ruby/lib/gitlab/git/repository.rb b/ruby/lib/gitlab/git/repository.rb index 7ef0f5b48..615d5cf11 100644 --- a/ruby/lib/gitlab/git/repository.rb +++ b/ruby/lib/gitlab/git/repository.rb @@ -133,9 +133,9 @@ module Gitlab end def set_rugged_search_path - return unless Gitlab.config.git.config_search_path.present? + return unless Gitlab.config.git.rugged_git_config_search_path.present? - Rugged::Settings['search_path_system'] = Gitlab.config.git.config_search_path + Rugged::Settings['search_path_system'] = Gitlab.config.git.rugged_git_config_search_path end def branch_names diff --git a/ruby/spec/lib/gitlab/git/repository_spec.rb b/ruby/spec/lib/gitlab/git/repository_spec.rb index 6344c1828..6a66f1e45 100644 --- a/ruby/spec/lib/gitlab/git/repository_spec.rb +++ b/ruby/spec/lib/gitlab/git/repository_spec.rb @@ -784,14 +784,14 @@ describe Gitlab::Git::Repository do # rubocop:disable Metrics/BlockLength end it 'sets Rugged search path settings' do - allow(Gitlab.config.git).to receive(:config_search_path).and_return(git_config_path) + allow(Gitlab.config.git).to receive(:rugged_git_config_search_path).and_return(git_config_path) expect(Rugged::Settings).to receive(:[]=).with('search_path_system', git_config_path) repository.rugged end it 'does not set Rugged search path settings' do - allow(Gitlab.config.git).to receive(:config_search_path).and_return("") + allow(Gitlab.config.git).to receive(:rugged_git_config_search_path).and_return("") expect(Rugged::Settings).not_to receive(:[]=) repository.rugged |